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.
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.
We need to loop through each Contact returned, using the Apply to each action
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
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)
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
- Status Reason- Select Draft
- Subject
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
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
Next, specify the unique ID of the Email Message created in the prior step
Finally, specify the IssueSend as Yes
Click Test
Select I'll perform the trigger action, Test and Run Flow
Once complete, you will see the emails as Sent in Dynamics:
Thanks for reading!
Aaron Richards
*This post is locked for comments