Skip to main content
Version: 10 - Vanillekipferl

Email Integration

Cloudomation Engine can send and receive emails.

Use Cases

With the email integration you can:

  • Send notifications about the status of an automated process.
  • Start an execution for each incoming email.
  • Add email approval steps to your automation processes.

Concept

Receiving Emails

Engine can receive emails from any IMAP server using the IMAP connector. See also the Connector Type IMAP documentation.

note

Engine currently only supports polling the IMAP server for messages. Push notifications are not currently implemented.

Sending Emails

There are two ways to send emails:

  • Through any SMTP server using the SMTP connector. This method allows to send to any email address. See Connector Type SMTP.

  • Through the SMTP integration. Using this method is simpler, but emails can only be sent to the email addresses of existing Engine user accounts in your workspace. See send_mail().

    :::tip example To send an email to yourself:

    import flow_api
    def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
    system.get_own_user().send_mail(
    'This is a test email to me',
    html='<h1>Heading</h1><p>This is a paragraph</p>'
    )
    return this.success('email sent')

    :::

    The send_mail method sends emails from info@cloudomation.com to the email address of the user. On premise installations need to configure an SMTP server to use this feature. If none is configured cloudomation falls back to writing a file with the email contents in the directory declared by the environment variable "NOTIFICATION_PATH". The message will be displayed in the logs in case this is also unconfigured.

Migrating to OAuth 2.0

If you use Gmail or Office 365 Outlook as your SMTP server, you need to migrate to OAuth 2.0 authentication if you haven't done so already. Support for basic authentication will be discontinued by Google and Microsoft in the future.

Here is how you can use OAuth 2.0 in your Engine email integration:

  1. Setting up the OAuth 2.0 client by following the respective instructions:
  2. Navigate to the workspace settings and set the following parameters:
    • SMTP_AUTHENTICATION_MODE: XOAUTH2,
    • SMTP_OAUTH2_CLIENT_ID: <created by you during the previous step>,
    • SMTP_OAUTH2_CLIENT_SECRET : <created by you during the previous step>
  3. (only if you manage your Engine workspace) Authorize workspace access to the mailbox by running the Engine installer like this:
    setup.sh --smtp-oauth-authorize
    The setup will then guide you through the following steps:
    1. Open the link to the consent screen of Google/Microsoft provided by the setup,
    2. press accept,
    3. after accepting, you will be redirected to a page with the final authorization code,
    4. enter the the final authorization code into the setup.

Learn More

Git Integration
Vault Integration
Connector Types