Using Email Trigger in Trigger loop Handle

You can use the email trigger to start the bot when an email is sent or received.

Prerequisites

In Automation Workspace, you added the Trigger loop Handle to your bot.

Procedure

  1. In the Trigger loop Handle, select Email in the Trigger on field.
    A list of options for the email trigger will appear for you to configure.
  2. Choose one of the following server types as the trigger for your incoming emails:
    Server type Steps
    Microsoft Outlook Click Outlook.

    Microsoft Outlook is set as the email service and the bot is triggered when you receive a new email.

    Email server Click Email server.
    1. Enter the email service Host information.

      For example, if you are using Office365 as your email service, enter Outlook.office365.com.

    2. Select IMAP or POP3.
      IMAP and POP3 are protocols used to connect to the mail server that enables you to read your emails through an email client. By default IMAP is selected.
      Note: The POP3 protocol has a known limitation where any new calender invite can also trigger the bot.
    3. Use secure connection (SSL/TLS): This option is selected by default. This option enables you to use a secure connection with the mail server.
    4. Enter the configured port number for your email server in the Port field.
    5. Select one of the following user authentication methods to sign in to the email server:
      • Basic
        • Credential: Click Pick to select the stored Username and Password.
        • Variable: Specify a variable.
        • Insecure string: Enter the username and password.
      • OAuth 2.0 - Client credentials
        • Specify the unique client and tenant IDs generated when you registered the application in the Microsoft Azure portal.
        • Specify the username you want to use to access the mail server.
        • Specify the client secret that you generated for your app in the app registration portal.
          For Client ID, Tenant ID, Username and Client Secret fields, choose from the following:
          • Credential: Use a value available in the credential vault.
          • Variable: Specify a variable.
          • Insecure string: Manually enter a value.
          Note: Client Credentials flow does not support Gmail.
      Note: The Email in folder does not support sub-folders when you set the protocol as POP3 for Email Server,
    EWS server Click EWS server.
    1. From the Microsoft Exchange Version drop-down menu, select the version that your organization is using.
      • Exchange Server 2013

        The Microsoft Exchange Server 2019 is now supported. Therefore, if your organization is using the Exchange Server 2013, 2016 or 2019 versions of the Microsoft Exchange Server, select Exchange Server 2013.

      • Exchange2010_SP2
      • Exchange2010_SP1
      • Exchange2010
      • Exchange2007_SP1

      For example, if you are using Microsoft Exchange Service Pack 2, select Exchange2010_SP2 as your email service.

    2. Enter the domain name, for example, smtp.office365.com
    3. Select one of the following user authentication methods to sign in to the email server:
      • Basic
        • Credential: Click Pick to select the stored Username and Password.
        • Variable: Specify a variable.
        • Insecure string: Enter the username and password.
      • OAuth 2.0 - Client credentials
        • Specify the unique client and tenant IDs generated when you registered the application in the Microsoft Azure portal.
        • Specify the username you want to use to access the mail server.
        • Specify the client secret that you generated for your app in the app registration portal.
          For Client ID, Tenant ID, Username and Client Secret fields, choose from the following:
          • Credential: Use a value available in the credential vault.
          • Variable: Specify a variable.
          • Insecure string: Manually enter a value.
          Note: There is no shared mailbox support for Microsoft Outlook but as a workaround, you can use the EWS server credentials flow with a shared email as a username string.
  3. Specify a time in the Check every field for all the server types to set the trigger interval.

    The trigger interval for the bot is set to 120 seconds by default. You can also specify the minutes.

    Note: The trigger interval that you have configured using the Check every drop-down menu does not depend on the number of emails received during the scheduled interval.
  4. Specify an email event for the selected server type in the Select Conditions fields.
    • Email from: Specify the email addresses.
    • Email subject contains: Specify that an email contains a condition.
    • Email without an attachment
    • Email with an attachment
    • Email in folder: Specify an email in a folder.
    Note: When you select the Email subject contains check box, the email trigger is executed depending on the following subject conditions:
    • When the subject line is provided within double quotation marks (""), for example, "ABC spreadsheet", the trigger is executed only when the email subject has an exact match for the string provided within quotation marks.
    • When multiple subject lines are separated by semicolons, for example, ABC spreadsheet; ABC project logs, the trigger is executed when the email subject matches any of the subject lines mentioned.
  5. Specify your variable in the Assigned to field.
    You can use this variable to retrieve various details about the email that triggered the bot, such as sender, recipient, subject, email content, date, action information, email server host, and port data.
    You can select from the following:
    • Multiple variables
    • Record
  6. Click Save to save your configuration.
    You have configured the email trigger for use with the trigger loop handle.