Hello all,
I was wondering if there is a way I can easily use Javascript in the Templates to generate dynamic HTML code in the email. We have used several Email systems that allow Scripting to enhance the HTML with current content. such as pulling parts of a remote Web Page into the HTML.
It would be similar to the way the XML tags are handled for the RSS feed templates. The JS returns the HTML payload which is then displayed in the selected location in the template.
Here is an example of what the Elastic Email software allowed and returned HTML from a web page:
<td id="jscontainer" align="left" valign="top">
{{ var today = new Date(); var dd = today.getDate().toString(); var mm = (today.getMonth()+1).toString(); var yyyy = today.getFullYear(); if(dd.length!=2) { dd="0"+dd }; if(mm.length!=2) { mm="0"+mm }; today = mm+dd+yyyy; var regex = new RegExp(today, "g"); var html = download('http://www.washingtontimes.com/newsletters/best-newt-gingrichs-idea-lab/'); html = html.replace(/\[\-EMAILADDR\-\]/g, email); html = html.replace(regex, Math.floor(Math.random() * (10000000000 - 100000000 +1)) + 100000000); }}
</td>
So, similar to the XML Feed Begin tags:
[XML_FEED_BEGIN url='[URL]http://feeds.feedburner.com/breitbart[/URL]' count='4']
Is there a tag that can recognize and process Javascript code?
Thank you.
I was wondering if there is a way I can easily use Javascript in the Templates to generate dynamic HTML code in the email. We have used several Email systems that allow Scripting to enhance the HTML with current content. such as pulling parts of a remote Web Page into the HTML.
It would be similar to the way the XML tags are handled for the RSS feed templates. The JS returns the HTML payload which is then displayed in the selected location in the template.
Here is an example of what the Elastic Email software allowed and returned HTML from a web page:
<td id="jscontainer" align="left" valign="top">
{{ var today = new Date(); var dd = today.getDate().toString(); var mm = (today.getMonth()+1).toString(); var yyyy = today.getFullYear(); if(dd.length!=2) { dd="0"+dd }; if(mm.length!=2) { mm="0"+mm }; today = mm+dd+yyyy; var regex = new RegExp(today, "g"); var html = download('http://www.washingtontimes.com/newsletters/best-newt-gingrichs-idea-lab/'); html = html.replace(/\[\-EMAILADDR\-\]/g, email); html = html.replace(regex, Math.floor(Math.random() * (10000000000 - 100000000 +1)) + 100000000); }}
</td>
So, similar to the XML Feed Begin tags:
[XML_FEED_BEGIN url='[URL]http://feeds.feedburner.com/breitbart[/URL]' count='4']
Is there a tag that can recognize and process Javascript code?
Thank you.