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
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
- 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.
▸ Press Run to execute.
Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.