Email Notification Customization

Yaseen2
Mega Expert

Dear All,

I've been requested to customize all notification emails that send to the users (all type of emails in including approval and assignment, and other tasks) to a more user friendly and good looking emails that have images and more organized texts, so my questions are : 1. is it recommended to modify the templets to have images

2. What is the easiest way to achieve it without too much customization.

Thanks a lot

1 ACCEPTED SOLUTION

Hi Yaseen,

That looks like quite a complex logo you need to show on your email, interesting.

Firstly the 'Unsubscribe and Preferences' is configured in an Email Layout with that name, it is then linked to an Email Template that has the same name, which you then link to your notification.  So if you want this to appear you will need to either modify the OOTB Email Layout called 'Unsubscribe and Preferences' or create your own one and add the code to the bottom of the email layout.

In regards to the logo and the HTML - this is outside my area of expertise, I was trying to help you link all the pieces together - Email Notification, Template and Layout, which I think I have done, but unfortunately I can't help with the logo part.  This logo issue would probably be best put through as a separate question on the forum so someone with HTML experience could assist.  It looks like the logo on the left side is being centered beside the text, perhaps you could force it to start at the top via html somehow?

You could also look at trying to combine the logo pieces into one and then see how this displays on the template - it currently looks like you have two separate pieces of the logo.

Hope this helps

Cheers Carl.

PS:  Please mark correct or helpful if it has been.

View solution in original post

6 REPLIES 6

Hi Yaseen,

That looks like quite a complex logo you need to show on your email, interesting.

Firstly the 'Unsubscribe and Preferences' is configured in an Email Layout with that name, it is then linked to an Email Template that has the same name, which you then link to your notification.  So if you want this to appear you will need to either modify the OOTB Email Layout called 'Unsubscribe and Preferences' or create your own one and add the code to the bottom of the email layout.

In regards to the logo and the HTML - this is outside my area of expertise, I was trying to help you link all the pieces together - Email Notification, Template and Layout, which I think I have done, but unfortunately I can't help with the logo part.  This logo issue would probably be best put through as a separate question on the forum so someone with HTML experience could assist.  It looks like the logo on the left side is being centered beside the text, perhaps you could force it to start at the top via html somehow?

You could also look at trying to combine the logo pieces into one and then see how this displays on the template - it currently looks like you have two separate pieces of the logo.

Hope this helps

Cheers Carl.

PS:  Please mark correct or helpful if it has been.

kchorny
Tera Guru

Came across this while searching for something else....

Write a mail script to print your logo in the email, then call that mail script from every notification.  If your logo changes, just upload a new image file and overwrite the existing, or upload a new image file and change the file name (below in bold) in the script include.  You can play around with the height and width settings till it looks good.

Mail script:

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

var eheader = new EmailUtils();
var hcont = eheader.setEmailHeader(current.sys_class_name);
template.print(hcont);

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

 

Script include function called by mail script:

setEmailHeader: function(taskType){
var header= "";
var instanceURL = gs.getProperty('glide.servlet.uri');

if (taskType == "incident") {
header = "<tr><td style='padding-left: 5pt;padding-right: 5pt';valign='center'><img src='" + instanceURL + "/logo_header2.jpgx' width='720px' height='123px'></img></td></tr>";
}
else {
header = "<tr><td style='padding-left: 5pt;padding-right: 5pt';valign='center'><img src='" + instanceURL + "/logo_header2.jpgx' width='720px' height='123px'></img></td></tr>";

}
return header;
},