Skip to main content

Notifications

Announcements

No record found.

Creating and Sending an Email from Dynamics 365 using Power Automate

Earlier, we looked at building out a dynamics recipient list for a new Email and how you can use that in the Outlook connector vs the challenges with doing the same thing in the Common Data Service (Current Environment) connector. You can see that post here.

 

 

If we know the entity type and number of recipients at the time of building the Flow, we can use the bound actions to actually send the email using Power Automate. This will only be possible in the Common Data Service (Current Environment) connector. If you use the standard Common Data Service connector, you will only be able to create an Email Message in Draft state.

 

 

 

Choose whichever trigger is necessary to create and send the email. In this case, I am simply using a Recurrence trigger for testing.

 

2555.pastedimage1585054531559v1.png

 

Below, I return the top 5 Contacts that have an email address for demonstration purposes. This is using the Common Data Service (Current Environment) connector.

 

 

8715.pastedimage1585054531569v2.png

 

 

We need to loop through each Contact returned, using the Apply to each action

 

8168.pastedimage1585054531579v3.png

 

 

When building the Email Message, the format is /entitylogicalname(recordid). Below, I populate the /contacts() and input the Contact GUID from the list returned from above

 

8233.pastedimage1585054531583v4.png

 

 

4314.pastedimage1585054531595v5.png

 

Once the recipient is populated, I click on Show Advanced Options. You will need to, at minimum, specify the following fields.

  • Description
  • Direction (Yes=outgoing, No=incoming)

4478.pastedimage1585054613563v6.png

 

One thing you will notice with the Description field (body), is that is currently does not support Rich Text formatting. There is a product suggestion here, that I would recommend voting on: Allow Rich Text Editor for email message entity

 

 

3644.pastedimage1585054613568v7.png

 

0447.pastedimage1585054613577v8.png

 

 

  • Status Reason- Select Draft
  • Subject

4152.pastedimage1585054628597v9.png

 

 

Once you have completed populating the data here, you need to actually send the Email, as it currently sits in Draft state.

 

Select Perform a bound action

 

8508.pastedimage1585054628602v10.png

 

 

When you specify the entity type, it will display a list of actions that are bound to the entity type. In this case, we select SendEmail

 

7041.pastedimage1585054628610v11.png

 

 

Next, specify the unique ID of the Email Message created in the prior step

 

 

 

1665.pastedimage1585054639832v12.png

 

 

Finally, specify the IssueSend as Yes

 

0285.pastedimage1585054639838v13.png

 

 

Click Test

 

3010.pastedimage1585054698236v14.png

 Select I'll perform the trigger action, Test and Run Flow

6180.pastedimage1585054761670v15.png

5432.pastedimage1585054768729v16.png

 

Once complete, you will see the emails as Sent in Dynamics:

 

8512.pastedimage1585054777781v17.png

 

 

Thanks for reading!

 

 

Aaron Richards

Comments

*This post is locked for comments