Email Layouts and Mail Script

Andrew Bettcher
Kilo Sage

Hi,

We have email layouts set up but we've been unable to work out how to have one template to serve all notifications. Instead, we've created several layouts that pull in the sys_class_name and then have an operator word in the header.

For example:

1. ${sys_class_name} Created

2. ${sys_class_name} Updated

We can then use the same ones for incidents, problemes etc.  We pull in the notification body in the standard way (${notification:body} but I'm wondering if there is a way to pull in another part of the notification? 

The fact that ${notification:body} is defined makes me think I should be able to call ${notification:header} or something similar but I don't know where to put the text in the notification that I want to use as the header. 

I've tried putting ${notification:header} in a layout to see what happens. The preview is entirely blank so I assume that it can't interpret the code. However, the whole thing is so versatile that I'd be surprised if I couldn't do something like this.

I'm wondering if I could create a new mail_script and simply call it but the same issue exists, to whit, where do I put the notification type on the notification in order to call it?

1 ACCEPTED SOLUTION

felladin
Tera Guru

Hello,

I did something similar, but my template has mail_scripts that handle most of the data (such as background colours and text depending on states/task tables).
A lot is handled using events instead of conditions on the notification. That way I can send commaseparated strings or objects and get data from them.

I did a write up: https://community.servicenow.com/community?id=community_article&sys_id=054deee5dbd0dbc01dcaf3231f961912

With regards
Anton

View solution in original post

2 REPLIES 2

felladin
Tera Guru

Hello,

I did something similar, but my template has mail_scripts that handle most of the data (such as background colours and text depending on states/task tables).
A lot is handled using events instead of conditions on the notification. That way I can send commaseparated strings or objects and get data from them.

I did a write up: https://community.servicenow.com/community?id=community_article&sys_id=054deee5dbd0dbc01dcaf3231f961912

With regards
Anton

Andrew Bettcher
Kilo Sage

That post is just what I was looking for.

 

Thank you.

 

VERY USEFUL