- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 03:49 AM
Hi All,
I'm trying to add custom notifications for each of the companies in our group. I've got various if statements running in the notification script identifying when you send what but i'm trying to send a signature that i have stored in a script field in a custom table.
The logic looks like this:
if(condition1){
var gr = new GlideRecord('custom_table');
gr.addQuery('field', value);
gr.query();
if(gr.next()){
var signature = gr.u_signature.getValue() //this is the script field in my custom table that holds the signature
//i don't know how to return this value into the body of the email
//template.print(signature)...?
//return signature...?
//everything i've tried so far just copies template.print('') multiple times.
for clarity the signature looks like a more complex version of:
template.print('<p><font size="3" color="#030000" face="arial">');
template.print('Tech Support');
template.print('</font></p>');
template.print('<img src="logo.png" width="154" height="90"/>');
Assistance would be great!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:54 AM
OK fixed it. I was trying to insert lines into the script rather than just content into the notification (if that makes sense). To that end i had prefixed every line in my custom table with template.print(). I took all those out and it's printing it properly now with template.print(signature);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:54 AM
OK fixed it. I was trying to insert lines into the script rather than just content into the notification (if that makes sense). To that end i had prefixed every line in my custom table with template.print(). I took all those out and it's printing it properly now with template.print(signature);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 06:01 AM
Great
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2018 12:38 PM
Depending on your implementation, you may be able to avoid scripting the addition of signatures by making use of Email Layouts, available in Istanbul and later releases.
See the layout documentation here.
Also, see this community response which may provide some general help:
Best practices for the architecture of outbound notification mails