How to configure Mail Box and Send Email Template using Power automate
Muhammad Arslan Khan
PUCIT | Power Platform | Dynamics 365 | ASP.NET MVC | ASP.NET Core | Dynamics 365 Plugins | SQL | JavaScript
Email Template allow to design email layout with runtime /dynamic values of record according to business requirements.Once email template is designed we can send it to customer ,agent or other related person.
Scenario: I have a custom entity named deliverable. I want whenever a record is added in table power automate send email with new created record information to owner of record using my created email template
Steps to follow:
1)Create Email template with dynamic values
2)Configure Email setting
3)Write a power automate flow to send out email
How to Create an email template
First of all we have to create an email template by following steps
1)Go to Advanced setting and click on Templates option ???
?
2)Click on email templates
3)Click on new and select Template Type “Global” for creating a template against custom entity
?
4)Name the email template, subject and inside body define content for email
?
?
5)Inserting dynamic value of record
(i) Use format : {!EntityLogicalName:FieldLogicalName;} (for insert entity column value)
(ii) For lookup value use format:? {!EntityLogicalName:FieldLogicalName/@name;}
(iii) For choice value use format: {!EntityLogicalName:FieldLogicalName/@name;}
?
6) For attachment in email click on? New Attachment option and choose file
?
Step2: Configure MailBox for sending and receiving email
Follow following steps to configure mailbox
1)Click on Admin center and goes to your environment
2)Click on setting
3)click on Email settings
?
4)Select and save settings
?
5)Now go to advanced setting->Email Configuration->Mailboxes
?
领英推荐
6)open the record? and click on Apply Default Email settings then Click on approve Email
?
7)Final step of email configuration click on Test and Enable MailBox then click on Activate button
Email is successfully Configured
?
9)Also select option Creating a new activity inside table properties against which template is developing
Step 3:
Created a power automate flow that trigger when a new record is added in table.
In flow we have to do following things
1)We have to get Id of email template that we have created
2)Retrieve Sender and receiver email address
3)Entity Name and record id whose information we want to get
?
?
?
1)Use List row action to filter required email template ??from email templates table and get id of template using expression first(outputs('filter_email_template_by_title')?['body/value'])?['templateid']
?
This step will give template id that we want to use
2)Use Perform an unbound action and fill out fields values
(i)Action Name: Choose option SendEmailFromTemplate
(ii)TemplateId: Set id of template
(iii)Regarding: This is record to be set as? regarding of email simply named custom entity logical name and id of newly created record.
(iv)Target: Use Json format to set value of sender and receiver. I am getting from and to values from systemuser table
Participationtypemask 1: is use to set from
Participationtypemask 2: is use to set to
?
Final Step is to add record in table that will trigger power automate flow and shout the email to owner
?
?
?
?
?
?
?