WebMail Pro 7 documentation

Add custom HTML with JS on any page

It's fairly simple to modify WebMail Pro templates and add custom HTML there. But when it comes to adding custom JavaScript, Knockout JavaScript library used in WebMail Pro will not allow that for security reasons.

To work around that, we have created Knockout binding that executes JavaScript in script tag in it, upon binding template to JavaScript model.

To add some JavaScript to login screen, open templates/views/Login/LoginViewModel.html template file and add the following code in its end:

<div data-bind="simpleTemplate: {}">
	<script>
		console.log('JS is working here!');
	</script>
</div>

If you wish to add JavaScript code executed for those users who are logged into WebMail Pro, you need to add the above code at the end of templates/views/Common/HeaderViewModel.html template file.

Upon making modifications in templates, be sure to purge data/cache/ content to apply changes.