Email Trigger
Starts a Workflow instance when an email is delivered to a dedicated email address. Attributes of each email, including attachments, subject, sender, and more, are available as fields in each instance started.
The subject line of the message sent to the Email trigger will be used as the name of the triggered instance.
Use Case
Like Web form triggers, this trigger lets non-PagerDuty Workflow Automation users initiate a Workflow instance with an email. Another common use is to parse files, since files can be passed to PagerDuty Workflow Automation as an attachment through sent emails.
How to configure this trigger
You can add new triggers or configure any existing triggers on a Workflow’s edit screen. Triggers are configured for each Workflow.
Each email trigger is set up with a unique email address with the format {your-custom-address}@{your PagerDuty Workflow Automation team}.pushbot.com
, such as submitaclaim@teamalpha.pushbot.com
Change the address at any time from the triggers page of your Workflow.
Please refrain from using the words when naming your email trigger:
-admin@
, autoreply.*@
, -autoresponder@
, autoresponder@
, -bounce@
, bounce-@
, bounce@
, -bounces@
, -confirm@
, daemon@
, -errors@
, exim@
, fetchmail@
, httpd@
, info@
, lighttpd@
, listmaster@
, listserv@
, mailer_daemon@
, mailer-daemon@
, mailer@
, mailman@
, mailmaster@
, majordom@
, majordomo@
, nagios@
, no-reply@
, nobody@
, noreply.*@
, -outgoing@
, -owner@
, owner-
, postmaster@
, -relay@
, reminder@
, -request@
, root@
, sales@
, server@
, squid@
, support@
, webmaster@
, www-data@
, www@
Fields for this trigger
What will this output?
Every incoming email starts an instance of a Workflow. Attributes of each email, including attachments, subject, or sender are available as fields within the Workflow.
How to reference a single attachment when an incoming email has multiple attachments
This trigger automatically outputs a table of trigger attachments whenever an incoming email includes attachments. If there is more than 1 file, use the following steps to reference a specific file.
To reference the files in that table, you can add and configure two actions in the Workflow: Tables: Look up data in a column and Text: Find text next to other text.
The following steps show how to add an action to look through each row of the table for a matching row, then a second action to look up the file ID in that row.
- To search the trigger attachments table, add a Tables: Look up data in a column action, and configure the action in as follows to search the
Extension
column forpdf
.- Data table:
{{trigger-attachments}}
- Lookup column name:
Extension
- Search term:
pdf
- Output field prefix:
extract-pdf
- Data table:
- Second, we use the Text: Find text next to other text action to extract the file ID from the data we looked up from the first step.
- Text to search:
{{extract-pdf--file}}
- Start type:
after-text
- Start value:
https://[insertteamnamehere].pushbot.com/v1/teams/[insertteamnamehere]/files/
- End type:
before-text
- End value:
/download
- Output field prefix:
pdf-file-id
- Text to search:
Then you can use the output from Step 2, {{pdf-file-id--first-match}}
, to reference the pdf file.
Output fields for this trigger
-
autorespond
- True or false for whether PagerDuty Workflow Automation responded to the sender with an automated email indicating that a new run was initiated.
-
bodytext
- Body of the email in plain text.
-
destinationEmails
- Comma separated string of all addresses where emails were sent. This will include the dedicated trigger address.
-
cc
- Comma separated string of any addresses that were CC’ed on the email
-
from
- Combination of the two fields
fullName
andfromEmail
in the format{{fullname}} <{{fromemail}}>
- Combination of the two fields
-
fromemail
- Email address of sender
-
fullname
- Full name of sender
-
html
- Body of the email in HTML
-
mailboxuser
- Portion of the
{{fromemail}}
before the @ symbol
- Portion of the
-
senttimestamp
- Time when the email was sent in
2019-02-27T22:58:21.145Z
format.
- Time when the email was sent in
-
subject
- Subject line of the email
-
to
- Array of all addresses that the email was addressed to
-
toemail
- Address of the Email trigger initiating the run
-
trigger-attachment
- The first attachment on the email. Any images in the body of the email will be treated as an attachment
-
trigger-attachment-filename
- Filename for email attachment, including file extension
- Any attachments that are sent through a email trigger will save to a Trigger Attachments data table
-
trigger-attachment-2 (3,4,5)
- If the email has multiple attachments, each additional attachment is output to a unique field. The 2nd file is output to
trigger-attachment-2
, the 3rd file totrigger-attachment-3
, and so on.
- If the email has multiple attachments, each additional attachment is output to a unique field. The 2nd file is output to
-
trigger-attachment-2-filename (3,4,5)
- If the email has multiple attachments, each additional attachment filename is output to a unique field. The 2nd filename is output to
trigger-attachment-2-filename
, the 3rd filename totrigger-attachment-3-filename
, and so on.
- If the email has multiple attachments, each additional attachment filename is output to a unique field. The 2nd filename is output to
-
Trigger attachments
- A data table with every attached file. Each table row is an attachment, and each column is an attribute of the attachment. The attribute columns listed in the table are:
- file
- A link to download the file.
- Name
- The name of the file, including the extension,
- Type
- The type of the file in
image/png
, orapplication/pdf
format.
- The type of the file in
- Extension
- The file extension of the file, such as
png
orjpg
.
- The file extension of the file, such as
- Size in Bytes
- The file size in bytes. This will be an integer.
- Location
- Either attachment or inline depending on how the recipient added the file.
- file
- A data table with every attached file. Each table row is an attachment, and each column is an attribute of the attachment. The attribute columns listed in the table are:
-
Trigger number of attachments
- The number of attachments included in the email.
Get help with a problem or question
If something’s not working as expected, or you’re looking for suggestions, check through the options below.
My inbound emails are not always triggering a new instance
This may happen if your inbound emails are especially long, such as threads with multiple nested replies and forwards. Because the email body is turned into a single field, it may hit the 128kb field size system limit.
How do I view all attachments included in an email
This action outputs a table in the Trigger attachments output field with a list of every attachment included in the email. It includes the file download URL, name, type, extension, size in bytes, and location of every file.
See How to reference a single attachment when an incoming email has multiple attachments for how to reference these files individually.
Thanks for your feedback
We update the Help Center daily, so expect changes soon.
Link Copied
Paste this URL anywhere to link straight to the section.