Notifications & email scripts
Send the right message to the right people, with dynamic content via mail scripts.
Notifications send email (and push/SMS) when something happens, a P1 incident, an approval request, an SLA breach. They are configured records: a when to send trigger, a who to send to audience, and a what to say body. Email scripts inject dynamic, computed content into that body.
- How a notification fires
- A mail script
- Best practices
- Try it Yourself
Notifications send email (and push/SMS) when something happens, a P1 incident, an approval request, an SLA breach. They are configured records: a when to send trigger, a who to send to audience, and a what to say body. Email scripts inject dynamic, computed content into that body.
How a notification fires
- Trigger, record inserted/updated matching a condition, or an event raised by code.
- Recipients, users, groups, fields on the record (e.g.
Assigned to), or dynamic lists. - Content, a template with field variables like
${number}and mail scripts for logic.
A mail script
gs.eventQueue()) from a business rule and have the notification listen for it. This keeps notification logic out of your business rules and makes the trigger reusable.Best practices
- Use notification email scripts, not inline logic, for anything conditional.
- Respect subscription preferences and avoid notification storms.
- Test with the preview and check the email logs.
Practice challenge
3 questionsQ1An email script is used to...
Inject dynamic content into the message
Email/mail scripts compute dynamic notification content.
Q2To decouple a complex trigger, you should...
Raise an event with gs.eventQueue()
Events let notifications listen without coupling to business rules.
Q3A field variable in a template looks like...
${number}
Notifications use ${field} substitution.
Frequently asked questions
What does the term Notifications & email scripts refer to in ServiceNow?
What is another point to note about Notifications & email scripts?
What else is worth knowing about Notifications & email scripts?
Want this taught live, with job support?
ServiceNow Training is delivered live by working practitioners, with certification prep and placement support.
See ServiceNow Training โ