- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 09:10 AM
I want to include the Notification name in outgoing emails, dynamically so I don't have to hard code it.
Is there a way to get at the Notification name with an email script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 09:42 AM
Hello Paul,
According to the documentation in the email scripts you have access to email_action which contains the GlideRecord for the email notification. Scripting for Email Notifications - ServiceNow Wiki
So it would be:
email_action.name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 09:42 AM
Hello Paul,
According to the documentation in the email scripts you have access to email_action which contains the GlideRecord for the email notification. Scripting for Email Notifications - ServiceNow Wiki
So it would be:
email_action.name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2015 11:37 AM
Thanks, that got me to this:
Setting Up Subscription Based Notifications - ServiceNow Wiki
<mail_script> template.print('<a href="' + gs.getProperty('glide.servlet.uri') + 'unsubscribe.do?sysparm_notification=' + email_action.sys_id + '"> Unsubscribe </a><br />\n'); </mail_script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 06:03 AM
Did you ever get this working? could you please post how this is used.
i've been looking but the wiki doesn't really help,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 06:14 AM
Yes, it works with the exact code I put into my last comment.
email_action is the object that represents the Notification so you can use email_action.name or email_action.sys_id etc