
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 12:26 PM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 12:33 PM
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.");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 08:55 AM
Greetings Jibarican
I am not sure if I follow your meaning here.
We are creating our own email notifications as the oob ones do not fit our purpose.
Are you suggesting that there is a better way?
Cheers
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2018 04:06 PM
That part is fine. Create notifications to server your purpose.
However, the script for such notification is overhead, complicated and an array of don'ts in programming. It's more maintainable to change this
(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);
to sys_ui_message
<table>
<tr>
<td>
Greetings ${current.caller.first_name}, <br />
Your message for IT Support: ${current.short_description} has been received. We will respond to you as soon as posssible.
</td>
</tr>
</table>
and call it like so from the email notification script
template.print(gs.getMessage('sys_ui_message_key_name'));
anything else isn't required. Not even the IIFE. there is no need to trigger another JavaScript tick when it can be bypassed given the script isn't doing anything but printing plain text

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 12:26 PM
And being an utter noob at Programming/Coding/Scripting I have to ask the question: IIFE?
I have no idea what IIFE is...
Thank you for your feedback Jibarican! it is important to me that I am building my environment in the best way possible! and I find guidance such as your to be invaluable!
Cheers
A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2018 06:04 PM