Email notification

gauri06
Tera Contributor

I want to create a notification if someone tag us in worknotes other than OOB notification , I want customized notification

3 ACCEPTED SOLUTIONS

Better to use Email Script for getting the content, as you would definitely need to do GlideRecord operations to get Demand Details.

 

Please find examples of Email Scripts in:
https://www.servicenow.com/docs/bundle/xanadu-platform-administration/page/script/server-scripting/r...

And at the end you can use the email script you created on your notification:
${mail_script:YOUR_CREATED_EMAIL_SCRIPT}


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@gauri06 

then do this

1) ensure the OOTB notification "Activity Stream @Mention Email" doesn't trigger for your dmn_demand table

Do this and save

AnkurBawiskar_0-1741338419401.png

 

2) Change the condition to this Table = dmn_demand, Change the Name and Click Insert and Stay and then add your own content in this newly created notification

AnkurBawiskar_1-1741338527297.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

@gauri06 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

16 REPLIES 16

Medi C
Giga Sage

@gauri06 

Please Navigate to System Notifications > Email > Notification.

Look for the notification "Activity Stream @Mention Email". Duplicate it and adjust as per your requirements.


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

gauri06
Tera Contributor

I want it only for demand table and I want to customize the email body

If this should be only triggered for Demand Table. Then Please

  • Duplicate the notification "Activity Stream @Mention Email"
  • Deactivate the OOTB one
  • Adjust the "Advanced Condition" script as follow:
function shouldSend() {
	var liveGroupProfileGR = new GlideRecord("live_group_profile");
	liveGroupProfileGR.setWorkflow(false);
	liveGroupProfileGR.addQuery("document", current.document);
	liveGroupProfileGR.addQuery("table", current.table);
	liveGroupProfileGR.addQuery("type", "!=", "support");
	liveGroupProfileGR.query();

	if(liveGroupProfileGR.next()) {
		var liveGroupMemberGR = new GlideRecord("live_group_member");
		liveGroupMemberGR.setWorkflow(false);
		liveGroupMemberGR.addQuery("group", liveGroupProfileGR.getUniqueValue());
		liveGroupMemberGR.addQuery("member", current.profile);
		liveGroupMemberGR.addQuery("state", "!=", "inactive");
		liveGroupMemberGR.query();

		if(liveGroupMemberGR.next()) {
			return false;
		}
	}

	var SecurityManager = new SNC.LiveFeedSecurityManager();
	return SecurityManager.canReadField(current.user, current.table, current.document, current.field_name);
}

shouldSend() && current.table == "dmn_demand";
  •  You can customize the content as per your requirements

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

gauri06
Tera Contributor

I want to edit the body so that it should take the input from demand table in notification such as number,short_description.etc