Custom JavaScript

MailDeveloper allows writing custom JavaScript to be executed upon exporting HTML. This makes it possible to modify the output HTML in any way desired. The most common usecase is to make a template suitable for use in a third-party service, such as MailChimp or StampReady, out of the box.

You can find the custom JavaScript editor under the Code-tab.

Example of some custom JavaScript for a template:

The JavaScript is executed in a separate web worker (a sandboxed environment). Regular JavaScript functionality is available, but access to e.g. console and DOM is restricted. You can use whatever version of JavaScript your browser supports (including ES6 features).

The web worker is populated with Cheerio for modifying HTML. Here are a few samples of what can be done: