Inbound Email Action Overview
Inbound Email Action Overview
Sangeeta Yadav-5082021a8
www.linkedin.com/in/sangeeta-yadav-sy02
Content
05 More Info
Sangeeta Yadav-5082021a8
What is Inbound Email Action?
Inbound email is mail sent from any user into ServiceNow. ServiceNow parses the incoming email and may or may not
take action in response.
Define an inbound email action to script how the system responds to an inbound email.
Note: Inbound email flows take priority over inbound email actions. If you create flows with inbound email triggers,
emails are first processed by the inbound email triggers before they are processed by inbound email actions.
Sangeeta Yadav-5082021a8
Parsing Inbound Email
When email is received, ServiceNow parses the email and populates the properties on the global email
variable.
• email.to: Contains a comma-separated list of email addresses in the To: and Cc: fields.
• email.direct: Contains a comma-separated list of email addresses in the To: field.
• email.copied: Contains a comma-separated list of email addresses in the Cc: field.
• email.body_text: Contains the body of the email as a plain text string.
• email.body_html: Contains the body of the email as an HTML string.
• email.from: Contains an email address that depends on the following conditions:
If the address listed in the email Headers field matches an existing user's Email address, this variable contains the
user's email address.
If the address listed in the email Headers field does not match an existing user's Email address, this variable contains
the address listed in the email Headers field.
• email.from_sys_id: Contains the Sys ID of the user who sent the email to the instance.
• email.origemail: Contains the email sender's address as listed in the email Headers field.
• email.subject: Contains the email's subject as a plain text string.
• email.recipients: Contains a comma-separated list of recipient addresses.
• email.recipients_array: Contains the recipient addresses as an array.
• email.content_type: Contains the MIME content type of the email (for example,text/plain; charset="us-ascii" or text/html;
charset="us-ascii").
• email.headers: Contains details about the sender, route,
Sangeetaand receiver as a plain text string in the format of the sending
Yadav-5082021a8
Sangeeta Yadav-5082021a8
Identifying the Sender
ServiceNow parses the sender of the inbound email into the email.from property and attempts to match the
email address to a record in the User [sys_user] table.
If a match is found:
• ServiceNow impersonates the user when taking action in response to the email.
• Scripts have access to the user's information through the GlideSystem methods such as gs.getUserName().
If no match is found:
• If automatic User creation is enabled, Users are created automatically and then impersonated.
• If automatic User creation is disabled, the user Guest is impersonated.
Sangeeta Yadav-5082021a8
Inbound email actions define what actions ServiceNow takes in response to incoming email.
Sangeeta Yadav-5082021a8
Inbound email receive types
The system classifies all incoming email into one of three types: forward, reply, or new.
Sangeeta Yadav-5082021a8
Watermark/Record Number
If an inbound message is recognized as a reply or forward ServiceNow attempts to match the incoming email with an existing
record by looking for a unique watermark in the subject line or message body. By default, watermarks are inserted as the last
line of outbound messages.
Conditions
The final step to determine which Inbound Action executes is to check
the conditions for a match. Use the Condition builder to create the
condition or write a Condition script. If there is no value in a condition
field, the field returns true.
Sangeeta Yadav-5082021a8
Sangeeta Yadav-5082021a8
Inbound Email Action Form
From: Select the user required to run the action. If a user is selected,
the action runs only when the email sender matches the user name.
Leave this field blank to perform the action for all users.
Conditions: Use the Condition Builder to specify the condition required to run the Inbound Action.
Condition: Write a server-side script to specify the condition required to run the Inbound Action.
Sangeeta Yadav-5082021a8
Actions Section
Field actions: Specify values to update in the record. Can use values parsed from
the incoming message.
When scripting, remember to call the current.update() method to update the record in the database.
Sangeeta Yadav-5082021a8
More Info
Inbound Email Actions process inbound email
Respond to email replies and forwards
Can also respond to New messages
Inbound Action scripts are server-side scripts which have access to:
• current
• event
• email
• logger
Use the System Mailboxes modules to determine if email is sent, received, or skipped
Sangeeta Yadav-5082021a8
THANKS
SERVICENOW
Sangeeta Yadav-5082021a8
www.linkedin.com/in/sangeeta-yadav-sy02