Using email templates in flow designer?

aj_becker
Tera Guru

Hello, 

I am creating flows in my instance, with flows that are sending emails.

Does anyone know how to use email templates within a flow email?  Right now its just a white background with nothing else.  We want to have these emails display universally like our other emails.

Thank You

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

check the below thread, it might help you:

https://community.servicenow.com/community?id=community_question&sys_id=ae2b0be6db020cd85129a851ca96...

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

sonjaroth
Giga Contributor

Unfortunately, I could not find a simple solution either, so I used a scripted body.



var bodyArr = [
    "Greeting",
    "some text",
    ];

var template = new GlideRecord('sys_email_layout');
template.addQuery('name', 'name of the template');
template.query();
if(template.next())
    return template.layout.replace("${notification:body}",bodyArr.join("<br/>"));
else
    return bodyArr.join("<br/>");



Hope this helps 🙂
Sonja

Hello @sonjaroth,

Thank you very much for sharing this solution, it works for me as well (out of all other solutions that I could try).

However, I am still finding a way to figure out way to set "${NOTIF_UNSUB}","${NOTIF_PREFS}" as well from this Scripted body. It appears as below -

 

 

Madhuri31_0-1737119570287.png

 

I was able to get the Template & Body set properly, but just not able to set/remove these 2 Options. 

Please share if you have tried that out to and worked for you.

Thank you very much in advance!

 

Best Regards

Madhuri