- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2020 06:39 AM
I have a mail script that I am calling from notification but get a message script is not found. I tried to call it using scope name like ${mail_script:my_scope.getinfo} but did not work. How can i do this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2020 04:42 PM
Hi,
Firstly, as others have mentioned, you shouldn't need to call your scope within the mail script, you just need the mail script name.
Secondly, I've seen this issue when people copy and paste code from somewhere else in to their notification.
Within your notification, please open that and go to the "What it will contain" tab, then click the "<>" (source code) button in the Message HTML section:
And check to see if there are any <span> tags, etc. around your mail script call. If so, please remove them.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2020 06:47 AM
Hi there,
Your mail script and notification are both in the same scope? If so, it should certainly work, no need to prefix with your scope or something.
Can you share exactly what you tried? And can you share an example of the issue?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2023 03:48 AM
Hey @Mark Roethof
<<Your mail script and notification are both in the same scope>>
Yes my mail script and notification are in same scope but my scenario is I need to access this notification in some different scope which is working fine, notification is getting triggered but the email script is not performing the result as expected for the notification.
Can you let me know, will the email script not work if we call the notification from some different scope ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2020 06:59 AM
Yes, both are in the same scope.
This is the error I get:
Email script render error: email script [mail_script:my_scope.getinfo ] does not exist
In the mail script I just added a simple line to test. Even that doesn't work. I looked to see if there are any html characters that might be causing the problem but didn't find any.
template.print('This is Test');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2020 07:08 AM
Yes but why the my_scope?
I just tested without, works fine.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field