How to italicize a called value in an email notification?

Shawn Horley
Kilo Guru

Greetings Folks

I have a notification script that advises our end-users when we receive their message. The notification pulls the subject line from the New Call Short description field. What I am looking for is how I would italicize the short description so as to make it more readable for our end users.

I know that <i> </I> is the element tag that I want to use, but I am not sure how to get that part into my script properly to achieve the output I want.

My script looks like this:

//Script for notification to caller that Email was received 
(function runMailScript(current, template, email, email_action, event) {
	template.print('<p><font size="5" color="#808080" face="Calibri"><strong>');
    template.print("Greetings " + current.caller.first_name +",");
    template.print('</strong></font></p>');
    template.print('<p><font size="3" color="#808080" face="Calibri"><strong>');
    template.print("Your message for IT Support: " + current.short_description + " has been received. We will respond to you as soon as possible.");
	template.print('</strong></font></p>');
})(current, template, email, email_action, event);

And I want to set the "current.short_description" in italics

Any suggestions?

Cheers

A.

1 ACCEPTED SOLUTION

Joel Millwood2
Kilo Guru

Hi Arthwys,

You can insert the tags directly into the print output:

template.print("Your message for IT Support: <i>" + current.short_description + "</i> has been received. We will respond to you as soon as possible.");

 

View solution in original post

8 REPLIES 8

Joel Millwood2
Kilo Guru

Hi Arthwys,

You can insert the tags directly into the print output:

template.print("Your message for IT Support: <i>" + current.short_description + "</i> has been received. We will respond to you as soon as possible.");

 

Wow, that simple? I was unaware that I could just put it in the midst of the line like that.

 

Thank you Joel!

 

Prateek kumar
Mega Sage

Try this

//Script for notification to caller that Email was received
(function runMailScript(current, template, email, email_action, event) {
template.print('<p><font size="5" color="#808080" face="Calibri"><strong>');
template.print("Greetings " + current.caller.first_name +",");
template.print('</strong></font></p>');
template.print('<p><i><font size="3" color="#808080" face="Calibri"><strong>');
template.print("Your message for IT Support: " + current.short_description + " has been received. We will respond to you as soon as possible.");
template.print('</strong></font></i></p>');
})(current, template, email, email_action, event);


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

Javier Arroyo
Kilo Guru

If you can, reconsider the approach of hard coding all that text into a mail script. Such basic modifications should never require updating scripts. Some of our emails are 100s of lines of text and the code is precisley one line of code.