- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 06:36 AM
I am looking for a way to change the existing mail_script API ${mail_script:ng_activity_mention_body} to display the @Mentions from work notes, instead of just the link to view messages in an incident.
-Thx!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 10:55 AM
See in bold below how we edited the ng_activity_mention_body to accomplish this. We also edited the subject of the emails above.
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
email.setSubject("You have been mentioned in " + recordGR.number +" | " + recordGR.getDisplayValue());
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>You have been mentioned by " + current.user_from.name + " in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + "</a></p>");
if (current.field_name == "comments") {
template.print(recordGR.comments.getJournalEntry(1) + "<br />");
}
else if (current.field_name == "work_notes") {
template.print(recordGR.work_notes.getJournalEntry(1) + "<br />");
}
}
Code thanks to Mike Kaufman!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 10:55 AM
See in bold below how we edited the ng_activity_mention_body to accomplish this. We also edited the subject of the emails above.
var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
email.setSubject("You have been mentioned in " + recordGR.number +" | " + recordGR.getDisplayValue());
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>You have been mentioned by " + current.user_from.name + " in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + recordGR.getDisplayValue() + "</a></p>");
if (current.field_name == "comments") {
template.print(recordGR.comments.getJournalEntry(1) + "<br />");
}
else if (current.field_name == "work_notes") {
template.print(recordGR.work_notes.getJournalEntry(1) + "<br />");
}
}
Code thanks to Mike Kaufman!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:07 AM
FANTASTIC! Thank you so much for sharing this!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:56 AM
Jason,
I believe you may share the solution of Laura into your today's thread: Display Text in Activity Stream @Mention Email Notification so others interested may see it and use it + with this action you may directly close the topic
Best Regards,
Georgi Mavrodiev
IT Consultant
Do IT Wise
You may visit us in our Web Site: www.doitwise.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:53 AM
Laura, Thank You! Excellent solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 11:55 AM
Thank you, Georgi for your input, also:)