Send mail as an impersonated user using Microsoft Graph API

Take control of your email appearance by using the Microsoft Graph API to send emails for you. Upload your own HTML templates into Rewst, and use them with the Microsoft Graph action. In the template, reference variables from the workflow to report on data gathered from workflows. The HTML Template lets you brand the email with your own custom logos and styling.

Prerequisites for impersonated email send

Set up the Microsoft Graph send mail action

  1. In the workflow builder, search for the action send mail as impersonated user.

  2. Drag the Microsoft Graph action onto the canvas.

  3. Fill out the required parameters, including:

    1. Subject

    2. User ID (AAD ID of sender)

      1. We recommend you set this as an Organizational variable

    3. Message Content

      1. HTML Templates can be used here, as well as plain text

    4. Message Content Type

      1. This should match the type of the above content

    5. To Recipient

      1. An array of recipients

    Other optional parameters include but are not limited to:

    • File attachments

      • Base 64 encoded file attachments. This could be a CSV generated by the workflow

    • Read Receipt

    • CC & BCC

    • Reply To

An image of the blank parameters menu for the Microsoft Graph action, ready to be filled out.
Find the parameters menu on the right side of your screen.

Tips

  • When used in conjunction with our core create webhook and await webhook actions, you can embed webhook links in the HTML message template for approval-related tasks.

  • Use free tools such as VS Code to render HTML for testing and creating templates.

  • Use Jinja in the HTML template to render data contained within the workflow.

Example HTML template for new user approval

A screen captured image of a sample HTML template to send in a custom email

You can embed your own logos in the HTML template. For example, the Rewst logo above is coded in the body:

A screen capture of a snippet of HTML code showing how an image logo can be embedded into the template
Example HTML, with logo embedded in the code

Last updated

Was this helpful?