In my previous blog, I have discussed how to send email to dynamic multiple recipients who are part of CRM (like members of a team or all contacts of an account etc.). Since all the email recipients are resolved entity references in CRM, it hasn’t been arduous for me to add existing users/contacts to email address fields. You can check out this blog here:
In this blog, I am going to educate you on how to send emails to unresolved references or just email addresses using MS power Automate features in Dynamics 365 CE.
Use Case 1: Send email to all contacts of an account but to the email address listed in emailaddress2. While it is pretty straight forward to send an email to one in emailaddress field because by default contact can be referenced by using the emailaddress field, the intriguing part is to send emails to the one stored in custom field or emailaddress2 field.
Use Case 2: You have a custom entity and you stored the email address in a custom field (text field). This entity is not enabled for sending emails.
1. Initialize an array variable
2. Retrieve all contacts (with emailaddress2 as one of the field) with a pre determined parent account
3. Append Email “From” user to above variable
Append to above array variable with the GUID of “From” user as shown above
4. Loop through all the retrieved contacts and append emailaddress2 to array variable
Here the participationtypemask is set to 2 signifying that this is “To” field. The actual emailaddress2 is binded with “addressused”.
5. Create new Email Record with above array variable as recipients
Click the “Switch to input array” button highlighted above which will let you enter the array
variable we constructed above.
6. Finally send email message using CRM bound action
CAUTION
Dont forget to turn on below setting in CRM or else you might encounter an error because by default the setting is turned off which prevents CRM from sending emails to unresolved email references
Setting -> Administration -> System Setting -> Email Tab -> Set Email from options
Happy CRM Em'Powering
*This post is locked for comments