Create a Power Automate button that sends an email

Completed

In this unit, you build an instant flow that sends an email to your manager with your current location and a photo of the vehicle that you're using.

  1. Sign in to Go to Power Automate.

  2. Select + Create on the left menu and then select Instant cloud flow.

  3. Enter Notify Your Manager as your Flow name. Select the Manually trigger a flow trigger, and then select Create to start building the flow.

    Screenshot of Notify Your Manager trigger with Manually trigger a flow added.

  4. Select the Manually trigger a flow trigger and then select + Add an input.

  5. Select File and rename File Content to Image.

    Screenshot of Manually trigger a flow with an image file added.

  6. Select the plus icon under Manually trigger a flow and select Add an action. Search for Office 365 Users. Under Actions, select the Get manager (V2) option.

  7. In the User (UPN) field, select fx from the blue box to open the expressions panel and type in:

    triggerOutputs()['headers']['x-ms-user-email']

    Then select Add.

  8. Select the plus icon under Get manager (V2) and select Add an action and search for Outlook and select Office 365 Outlook.

  9. Under Actions, find and select the Send an email (V2) option. If using the new designer, you might need to select the See more option.

  10. In the To field, select the lightning bolt (you might need to select Enter custom value) to open the Dynamic content section. Under Get manager (V2), search for and select Mail. You might have to select See more to find Mail.

    Screenshot of Send an email with Dynamic content for the To field showing and the See more button highlighted next to Get manager.

  11. Set the Subject field to My current location and vehicle I am using.

  12. Set the Body field to the following text:

    Hi
    
    I have arrived at my current location and attached is a picture of the vehicle I am currently using.
    
    Address:
    
  13. In the Body field, after the word Hi, select Display Name from the Dynamic content window under Get manager (V2).

  14. In the Body field, below Address:, select Full address, from the Dynamic content window under Manually trigger a flow. You might have to scroll down a bit to find it.

  15. Select Show All next to Advanced Parameters to add the photo as an attachment.

  16. Select Add new item in the Attachments field.

  17. Set the Attachments Name - 1 field to any name you would like to use followed by the .jpg extension. Then set the Attachments Content - 1 field to the following expression:

    base64ToBinary(triggerBody()?['file']?['contentBytes'])

  18. Save the flow.

  19. You can now test the instant flow by using your smartphone. Open the app and select the Instant Flows option on the lower horizontal menu. Select Notify Your Manager. To add an image, select the folder icon and add an image by taking a new picture with your camera or by using an existing image from your photo library.

    Your manager will get an email with an image attached.