Notification Email Script

ceraulo
Mega Guru

Hello!

I am creating an email notification script that uses different font size and color. This is my script:

(function runMailScript(current, template, email, email_action, event) {
template.print('<p><font size="16" color="#808080" face="arial"><strong>');
template.print(gs.getMessage('ITSM'));
template.print('</strong></font></p>');
template.print('<p><font size="12" color="#000000" face="arial"><strong>');
template.print(gs.getMessage('${number} - ${short_description}'));
template.print('</strong></font></p>');

})(current, template, email, email_action, event);

However, when I add this to an email notification the email generated displays the text 'ITSM' and 'INC-SHORT DESC' with the correct color and face BUT the size is not "16" and "12", respectively.

Please help!

Thank you.

 

4 REPLIES 4

VigneshMC
Mega Sage

Not sure if this the reason, this is what i found in w3 site

The size attribute of <font> is not supported in HTML5. Use CSS instead.

CSS syntax: <p style="font-size:20px">

Thanks

Chandra Prakash
Tera Expert

Hi,

I have done some changes in your script  for using Inline CSS in HTML Template.

(function runMailScript(current, template, email, email_action, event) {
template.print('<p style="font-size:16px; color:#808080; font-family:arial"><strong>');
template.print(gs.getMessage('ITSM'));
template.print('</strong></p>');
template.print('<p style="font-size:12px; color:#000000; font-family:arial"><strong>');
template.print(gs.getMessage('${number} - ${short_description}'));
template.print('</strong></p>');

})(current, template, email, email_action, event);

Let me know if you are facing any issues.

Mark Correct if it helps.

Regards,

Chandra Prakash

Hey Chandra. It does not recognize the color, font and size. When checking the generated email in Outlook, the color is black and font is Times New Roman instead of Arial.

Refer this Blog, to get some more information to apply CSS in Email Scripts.

 

Mark Correct if it helps.

Regards,

Chandra Prakash