Add and configure Send Email

The Send Email step sends an email notification to one or more recipients when the step is run. This step type can be used to send notifications when a step or job is completed or when a step didn't complete successfully.

You can optionally configure email notification settings for ArcGIS Workflow Manager before sending email notifications with the Send Email step. Custom SMTP server settings allow you to include attachments, use email addresses instead of usernames or a group ID, and enable the CC and BCC text boxes.

Note:

You may need to modify custom roles to retrieve organization member's email addresses with ArcGIS Arcade expressions.

Configure the step

To configure the step, do the following:

  1. Create or edit a workflow diagram to access the Step Library panel.
  2. Drag Send Email from the Step Library panel to a connection arrow of a step on the workflow canvas.

    The Step Details panel appears.

  3. Provide a name for the step in the Step Name text box.
  4. Optionally, click the Enable custom SMTP server toggle button to use your SMTP server to send emails.
  5. If you don't have a custom SMTP server, choose one of the following Recipient Type options and provide recipients in the To text box:
    • Usernames—Provide a list of usernames separated by a semicolon or use an Arcade expression to create a dynamic list of recipients. Arcade expressions must be enclosed in double quotation marks.
    • Group ID—Provide a single group ID or use an Arcade expression to retrieve a group ID. Arcade expressions must be enclosed in double quotation marks.

    At least one valid username, group ID, or Arcade expression must be provided in the To text box.

    Caution:

    If you don't have a custom SMTP server, the maximum number of recipients is 50. Arcade expressions may cause the recipients list to exceed the maximum size limit.

    One username

    JDoe

    One group ID

    7dr6de56442840ccbf49b3f869f49b27

    Multiple usernames

    JDoe;KSmith;MFields

    One Arcade expression

    "GetUser($CurrentPortal, jobOwner($job))['username']"

    Multiple Arcade expressions

    "GetUser($CurrentPortal, jobOwner($job))['username']";"jobCreator($job)";"lastRunner($job, '8b107614-c6dc-20b3-c232-e03bf7c007bc')"

    Usernames and Arcade expressions

    JDoe;"GetUser($CurrentPortal, jobOwner($job))['username']";KSmith;"lastRunner($job, '8b107614-c6dc-20b3-c232-e03bf7c007bc')"

    Tip:

    Click This input supports Arcade Expressions This input supports Arcade expressions and choose an ArcGIS Arcade expression to add it to its associated text box.

  6. If you have a custom SMTP server, provide email addresses separated by a semicolon in the To, CC, and BCC text boxes as necessary, or use an ArcGIS Arcade expression to create a dynamic list of recipients. Arcade expressions must be enclosed in double quotation marks.

    At least one valid email address or Arcade expression must be provided in the To, CC, or BCC text box.

    One email address

    user1@test.com

    Multiple email addresses

    user1@test.com;user2@test.com;user3@test.com;user4@test.com

    One Arcade expression

    "GetUser($CurrentPortal, JobOwner($Job))['Email']"

    Multiple Arcade expressions

    "GetUser($CurrentPortal, JobOwner($Job))['Email']";"GetUser($CurrentPortal)['Email']";"GetUser($CurrentPortal, LastRunner($Job, 'f50d740d-cc04-9296-4ce3-181e82604465'))['Email']"

    Email addresses and Arcade expressions

    user1@test.com;"GetUser($CurrentPortal, JobOwner($Job))['Email']";user3@test.com;"GetUser($CurrentPortal)['Email']"

    Tip:

    Click This input supports Arcade Expressions This input supports Arcade expressions and choose an ArcGIS Arcade expression to add it to its associated text box.

  7. Provide a subject for the email notification in the Subject text box.

    You must provide a subject. The Subject text box cannot be left blank.

    You can also use Arcade expressions to provide a dynamic value for the subject. If the subject contains plain text and Arcade expressions, format the text as follows:

    JobName($Job) + 'is ready'

  8. Provide the message text for the email notification in the Body text box.

    You must provide a message in the body. The Body text box cannot be left blank.

    You can also use Arcade expressions to provide a dynamic value for the body.

    If the body contains plain text and Arcade expressions, format the text as follows:

    '<b>' + JobName($Job) + '</b>, created by <b>' + JobCreator($Job) + '</b>, was started on <b>' + Text(Date(JobStartDate($Job)), 'dddd, MMMM D, Y') + '</b>.'
    Caution:

    If you don't have a custom SMTP server, the email body size is limited to 100 KB. Arcade expressions may cause the body to exceed the maximum size limit.

  9. If you have a custom SMTP server, you can include attachments in the email notification using the following options under Include Attachments:
    • None—Don't include job attachments in the email notification.
    • All—Include all job attachment folders in the email notification.
    • By Folder—Provide a comma-separated list of job attachment folder names in the By Folder text box to specify the job attachment folders to include in the email notification.
      Note:

      Job attachment folders are contained in the workflow item and are not file system paths.

    Note:

    If a job contains multiple attachments, they are sent as a single .zip file, and the job's attachment folder structure is maintained.

  10. Optionally, click Preview email to preview the email.
    Note:

    If the email contains a job-specific Arcade expression, you must provide a valid job ID in the Preview Email text box before you can preview the Arcade expression. If the email contains an Arcade expression for the output value of a step, the step must be completed before you can preview the output value.

    The Email Preview window appears with a list of recipients and a preview of the subject and body.

  11. Click the Options tab.
  12. Configure Step Options as necessary:
    • Manual—Run the step manually.
      • Optional—Allow the step to be finished without being run.
    • Automatic—Run the step as soon as it becomes active.
      Note:

      If the workflow diagram is configured to automatically run a sequence of steps that includes the Run GP Service step, steps that attempt to run after the user token expires will not run automatically. The ArcGIS Workflow Manager Advanced organization extension is required to run additional automated steps without manual intervention.

    • Run on a Schedule—Run the step according to a set schedule.

      Learn more about scheduling options

  13. Optionally, choose one of the following options to configure help in the step:
    • None—Configure the step without step help.
    • Text—Configure help text for the step in the Text text box.

      You can use ArcGIS Arcade expressions to provide a dynamic value for the step help. If the step help contains plain text and Arcade expressions, format the text as follows:

      
      'For further assistance, please contact' + JobCreator($Job) + '.'

    • URL—Configure the step with a link to a help resource in the URL text box.
      Note:

      Steps that are run in the web app only support HTTP and HTTPS URL formats. Steps that are run in ArcGIS Pro support HTTP, HTTPS, and file formats.

      You can also use Arcade expressions to provide a dynamic value. If the URL contains plain text and Arcade expressions, format the text as follows:

      
      'https://pro.arcgis.com/en/pro-app/latest/tool-reference/' + JobExtendedProperty($Job, 'tools', 'toolbox') + '/' + jobExtendedProperty($job, 'tools', 'alias') + '.htm'

      Configure the Automatically Encode Arcade Result check box as follows:

      • If an Arcade expression returns special characters that must be escaped when converted to a URL, such as a space or a forward slash, ensure that the Automatically Encode Arcade Result check box is checked.
      • If an Arcade expression is used to form the base URL, uncheck the Automatically Encode Arcade Result check box.

  14. Optionally, click the Style tab to change the shape and color of the step.
  15. Optionally, click the About tab and provide a description for the step in the Step Description text box.
    Tip:

    The About tab also contains the step's ID that can be used with dynamic job properties to obtain a step's output. Click Copy Step ID Copy Step ID to copy the step ID to the clipboard.

Return value

When the step is completed, its return value is stored to indicate the result of the step. The return value can be immediately evaluated using paths to determine the next steps in the workflow. You can also retrieve the return value for completed steps throughout the workflow using ArcGIS Arcade expressions. The following table lists the step's return values:

Return valueDescription

S000001

The step completed successfully.

F000001

The step failed to complete successfully.

Related topics