Inbound and Outbound Email in ServiceNow – CAD Exam Guide
Why Inbound and Outbound Email Is Important
Email is one of the most fundamental communication channels in any organization, and ServiceNow leverages it extensively to automate workflows, notify users, and even create or update records. For the ServiceNow Certified Application Developer (CAD) exam, understanding how inbound and outbound email works is essential because it touches on automation, notifications, system properties, and integration — all of which are core competencies tested on the exam.
In real-world implementations, email automation reduces manual effort, ensures timely communication, and provides a seamless experience for end users who may interact with ServiceNow without ever logging into the platform directly. Misconfiguring email can lead to lost requests, spam, security vulnerabilities, or broken workflows.
What Is Inbound and Outbound Email?
Outbound Email refers to emails sent from ServiceNow to external recipients. This includes:
- Notifications: Triggered by events on records (e.g., incident assigned, change approved). These are configured through the Notification record in System Notification > Email > Notifications.
- Email generated via scripts: Using the GlideEmailOutbound API or the gs.eventQueue() method to trigger event-based notifications.
Inbound Email refers to emails sent to ServiceNow from external users or systems. ServiceNow processes these emails and can:
- Create new records (e.g., a user emails the service desk and an incident is created automatically).
- Update existing records (e.g., replying to a notification thread updates the associated record).
- Trigger workflows or business rules based on the email content.
How Outbound Email Works
1. Events and Notifications: When something happens on a record (e.g., state changes), an event is generated. Notifications are registered to listen for specific events.
2. Notification Configuration: Each notification record defines: When to send (conditions and events), Who will receive (users, groups, specific email addresses), and What to send (subject, body, using mail scripts or templates).
3. Mail Scripts: These are server-side scripts included in notification email templates using the syntax ${mail_script:script_name}. They allow dynamic content generation.
4. Email Layouts and Templates: ServiceNow uses email layouts to wrap notifications in consistent formatting (headers, footers, branding). Templates provide reusable content structures.
5. SMTP Configuration: Outbound emails are sent through an SMTP server configured under System Mailboxes > Outbound. The system property glide.email.smtp.active must be set to true for outbound email to function.
6. Email Logs: All outbound emails are logged in the sys_email table with a type of sent or send-ready. Administrators can review these for troubleshooting.
How Inbound Email Works
1. Email Accounts: ServiceNow retrieves inbound emails via POP3 or IMAP protocols from configured mailboxes under System Mailboxes > Inbound.
2. Inbound Email Actions (Inbound Actions): These are the key mechanism for processing inbound emails. Each inbound action defines:
- Target table: The table on which to create or update a record.
- Conditions: When the action should fire (based on sender, subject, body content, etc.).
- Script: Server-side JavaScript that processes the email and performs the actual record creation or update. The script has access to objects like email (the inbound email), current (the target record), and email.body_text.
3. Watermark: ServiceNow uses a unique watermark (a hidden identifier embedded in outbound notification emails) to correlate reply emails with existing records. When a user replies to a notification, the watermark helps ServiceNow identify which record to update. The watermark is stored as a unique string and is critical for the reply-based update mechanism.
4. Processing Order: When an inbound email arrives, ServiceNow first checks for a watermark to match it to an existing record. If a match is found, the corresponding inbound action for updates runs. If no watermark is found, ServiceNow evaluates inbound actions that create new records based on conditions.
5. Email Filters: Administrators can set up filters to block or redirect unwanted inbound emails (e.g., spam, auto-replies, out-of-office messages).
Key System Properties
- glide.email.read.active — Enables or disables inbound email processing (true/false).
- glide.email.smtp.active — Enables or disables outbound email sending (true/false).
- glide.email.test.user — When set, all outbound emails are redirected to this user (useful for testing).
- glide.email.watermark.stamp — Controls whether watermarks are added to outgoing emails.
Key Scripting Objects for Inbound Email
Within inbound email action scripts, you have access to:
- email.body_text — The plain text body of the email.
- email.html — The HTML body of the email.
- email.subject — The subject line.
- email.from — The sender's email address.
- email.to — The recipient email address.
- email.headers — A Java object containing the email headers.
- current — The GlideRecord for the target record being created or updated.
Key Scripting for Outbound Email (Mail Scripts)
Mail scripts use the template object and email object:
- template.print() — Outputs text into the email body.
- email.setSubject() — Sets the email subject dynamically.
- email.setBody() — Sets the email body dynamically.
- email.addAddress() — Adds recipients dynamically.
Common Use Cases
- A user sends an email to servicedesk@company.com and an incident is automatically created with the email body as the description.
- A user replies to a notification about their incident, and the reply is added as a work note or comment.
- Notifications are sent when an incident is assigned, updated, or resolved.
- A scheduled job sends a summary email report to managers.
Exam Tips: Answering Questions on Inbound and Outbound Email
1. Know the difference between Notifications and Inbound Actions: Notifications = outbound (sending email out). Inbound Actions = inbound (processing email coming in). The exam may present scenarios where you need to identify which feature to use.
2. Understand watermarks thoroughly: Expect questions about how ServiceNow correlates a reply email with an existing record. The answer is always the watermark. Know that watermarks are embedded in outbound emails and used to match inbound replies.
3. Remember system properties: Know which properties control inbound vs. outbound email. A common exam question tests whether you know that glide.email.read.active controls inbound and glide.email.smtp.active controls outbound.
4. Know the scripting objects: Understand that in inbound email action scripts, the email object provides access to the sender, subject, body, and headers. Know that current represents the record being created or updated.
5. Understand the processing flow: Inbound emails are first checked for watermarks, then matched against inbound actions. Questions may test the order of operations.
6. Test email redirect: Know that the property glide.email.test.user redirects all outbound emails to a specified user. This is a commonly tested property for development and testing scenarios.
7. Mail scripts vs. notification templates: Know that mail scripts provide dynamic, scripted content inside notifications using the ${mail_script:name} syntax. They are more flexible than static templates.
8. Conditions on notifications: Understand that notifications can be triggered by events, by record conditions, or both. The "When to send" section is critical — know the difference between "Event is fired" and "A record is inserted or updated."
9. Email digests: Be aware that ServiceNow supports email digests, which batch multiple notifications into a single email sent at a scheduled interval. This reduces email volume for users.
10. Elimination strategy: If a question asks about creating records from external emails, the answer involves Inbound Actions. If it asks about sending information to users, the answer involves Notifications. If it asks about correlating replies, the answer is watermarks. Use these patterns to quickly eliminate wrong answers.
11. Practice with scenarios: The CAD exam often presents scenario-based questions. Practice identifying whether a scenario requires inbound processing, outbound notification configuration, mail scripts, or system property changes.
By mastering these concepts, you will be well-prepared to handle any email-related question on the ServiceNow CAD exam confidently and accurately.