The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Apply Email Template in Notification

Steven Young
Tera Guru

Hey Again all you Genius's.   I need your help again.

This is kind of a "idea" rather than it being functional (i think).

So here's the deal.

I love ${mail_script:scriptname}   it's awesome.   Very functional, works like a charm.

We have a request item that we have an approval email for.   Then there is a UI action that was create to fire an Event.   We created a 2nd email notification to accept this event to fire the "Resend email"

here's the deal.

The approval email we have a ${mailscript}   at the very top which contains our approval/reject links.   and Information about the request.
Then we have the BODY of the email.   Contains the variables of the request.

Then we have 2 ${mailscript}'s at the bottom with some "for the administrator"   which tells us the ticket number, what email notification send this email, and so forth.

approval.JPG

Here is where the question comes in.   We cant use an HTML template for all the notifications because we add different ${mailscripts}
approval2.JPG

What i'm wanting to know is:
Can we Create a template, that is dynamic like the mail scripts

So in my email notification, i dont have a template "attached" and used.
BUT.   i used something like ${template:templatename}   Because the body of my email wont change.

Is there a way to do something like so.

${mail_script:Approval-Reminder}
${mail_script:Approval-Links}


${template:templatename}

${mail_script:Approval-Additional}


${mail_script:Approval-Administrator}

Where the ${template} will actually pull the HTML data out of the template.
This way i would only have to update it 1 time and it would update in all 3 of my notifications.
I do not want to use the text box.   i want to use HTML.   i dont want to have to use the <mail_script> template.print() for every single line,   Hence using the HTML (WYSIWYG)

Does that make any sense at all?

it would be great for the templates if you attach it as is to the email and it's used with no modifications.   or if you could "call" the template data into the actual email notification like the mailscripts.

1 ACCEPTED SOLUTION

Steven Young
Tera Guru

So i found my answer.   Dot Walk.


Create an email script, say called "template"


Script will be


template.print(email_action.template.message_html);



That will take the reference field of the "template" from the email notification and then pull the HTML field from the template.



Then in the email notification you can do a ${mail_script:template}   and that is all that is needed.



So now my email Notification html box looks like so:
Capture1.JPG




It will translate into this


Capture2.JPG


View solution in original post

34 REPLIES 34

I would like to know as well. Working on a complicated mail script and this might prove useful.


Tried the below lines, but nothing worked :



1. <span style="color: green; font-weight: bold;"> APPROVE</span>



2. template.print('Click here to <span style="color:green;font-weight:bold">APPROVE</span>');



The screenshot that I've shared earlier is from the requirement doc. I am just seeing links in BLUE in the email. Is there a way to change only a word in the links ?



find_real_file.png




what about something like this?  


Ignore the Incident number.   it's just easier to update an incident than it is to resubmit a request to get an approval email.



I'm not sure about just changing a Link color.   i think it can be done, but i've had issues with the HTML in the past.



This is the idea i am proposing to my management after the thanksgiving holiday.


it's a button,   the entire thing is clickable.



I just threw this together real quick.   i'm going to bed but i'll clean up the code and post it later.


Looks interesting. Let me put this forth in front of the management. I am pretty sure they would buy this idea of buttons in the approval mail.


Hey Steve, the Business seemed to be very much excited to have the 2 buttons in approval mail.



Looking forward for your code,mate !