For the Activity Stream @Mention Email notification, include the text of the comment

kluces
Kilo Contributor

My customers see value in including the text where they were "@mention" in the Activity Stream @Mention Email notification. This way they will not have to login to our instance to view the comment.

I don't what the entire Activity stream, just the entry where they were mentioned into the Activity Stream @Mention Email notification.

Thanks in advance.find_real_file.png

1 ACCEPTED SOLUTION

sachin_namjoshi
Kilo Patron
Kilo Patron

Activity steam  notifications are implemented in below notificatiion

find_real_file.png

and this notifications calls email script $ng_activity_mention_body

You will have to update ng_activity_mention_body email script to include comments like below

var recordGR = new GlideRecord(current.table);
if(recordGR.get(current.document)) {
	var displayValue = recordGR.getDisplayValue();
	var subjectText = displayValue
		? displayValue
		: "a record discussion";
	var tableDisplay = recordGR.getClassDisplayValue();
	var linkText = displayValue
		? "the " + tableDisplay  + " record " + displayValue
		: "this " + tableDisplay  + " record ";

	email.setSubject("You have been mentioned in " + subjectText);
	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 + "with comments as " +  recordGR.comments.getJournalEntry(1) + " in <a href='/" + recordGR.getRecordClassName() + ".do?sys_id=" + recordGR.getUniqueValue() + "'>" + linkText + "</a></p>");
}

find_real_file.png

View solution in original post

7 REPLIES 7

kluces
Kilo Contributor

My Admin was able to implement this code and it worked perfectly. We greatly appreciate your help.

Ricky Singh
Tera Expert

HI Sachin this script did not work for me, still shows the same output as before without the message just states" that you have been mentioned by <username> in a <record number> 

But the actual comment does not show. 

 

I updated the above script on the "when to send" tab is there any update needed on the "what to send" ?

Ricky Singh
Tera Expert

My bad I updated it in the wrong place entirely. found the script include.