{"id":24879,"date":"2020-09-25T07:50:41","date_gmt":"2020-09-25T07:50:41","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=24879"},"modified":"2023-03-17T11:09:58","modified_gmt":"2023-03-17T05:39:58","slug":"power-automate-send-an-email-using-the-email-template-part-2","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/09\/power-automate-send-an-email-using-the-email-template-part-2\/","title":{"rendered":"Power Automate: Send an email using the Email Template \u2013 Part 2"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p style=\"text-align: justify;\">In our <a href=\"https:\/\/www.inogic.com\/blog\/2020\/09\/power-automate-send-an-email-using-the-email-template-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">last blog<\/a>, we saw how we could create Power Automate Flow to send an email using the Email Template. We used \u201c<strong>SendEmailFromTemplate<\/strong>\u201d action to send a single email.<\/p>\n<p>Now, in this blog, we will see how we can send bulk email messages using the Email Template.<\/p>\n<p>Let us say, we want to send emails to reconnect with all our contacts in the system that we have not been in contact with for a while.<\/p>\n<p>Below is how we can achieve this using the Power Automate. This could help you to create Power Automate Flow for your requirements where you may want to send bulk email messages.<\/p>\n<h2><strong>Setup trigger for the Power Automate<\/strong><\/h2>\n<p>For this example, I have used \u2018Manually trigger a flow\u2019 trigger.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24880 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-1.png\" alt=\"Send bulk emails using the Email Template\" width=\"636\" height=\"130\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-1.png 636w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-1-300x61.png 300w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/a><\/p>\n<h2><strong>Retrieve Email template<\/strong><\/h2>\n<p style=\"text-align: justify;\">We will add \u2018List Records\u2019 step of Common Data Service Connector (Current) to retrieve the Email Template by its name (Title). We are retrieving the \u2018Contact Reconnect\u2019 template.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24891 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2.png\" alt=\"Send bulk emails using the Email Template\" width=\"793\" height=\"430\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2.png 793w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2-300x163.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2-768x416.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-2-660x358.png 660w\" sizes=\"(max-width: 793px) 100vw, 793px\" \/><\/a><\/p>\n<p>Add filter query to retrieve template by the title as shown below<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24890 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-3.png\" alt=\"Send bulk emails using the Email Template\" width=\"631\" height=\"406\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-3.png 631w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-3-300x193.png 300w\" sizes=\"(max-width: 631px) 100vw, 631px\" \/><\/a><\/p>\n<p>This step will return the \u201cContact Reconnect\u201d template. We will need this GUID of the template in the next step.<\/p>\n<h2><strong>Retrieve records for which we want to send email<\/strong><\/h2>\n<p style=\"text-align: justify;\">I am retrieving contacts from the system which I want to reconnect.\u00a0 We will add \u2018List Records\u2019 step and will retrieve contacts.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-4.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24889 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-4.png\" alt=\"Send bulk emails using the Email Template\" width=\"637\" height=\"155\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-4.png 637w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-4-300x73.png 300w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/><\/a><\/p>\n<h2><strong>Initialize variable and store array of record\u2019s GUID<\/strong><\/h2>\n<p style=\"text-align: justify;\">As we want to send separate emails to each individual contact, we will first store GUID\u2019s of each contact in an array variable.<\/p>\n<p>First, initialize the array variable<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24888 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-5.png\" alt=\"Send bulk emails using the Email Template\" width=\"635\" height=\"190\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-5.png 635w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-5-300x90.png 300w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><\/a><\/p>\n<p>Then, loop through all contacts retrieved in the above step and append GUID\u2019s of each record to the array.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-6.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24887 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-6.png\" alt=\"Send bulk emails using the Email Template\" width=\"669\" height=\"401\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-6.png 669w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-6-300x180.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-6-660x396.png 660w\" sizes=\"(max-width: 669px) 100vw, 669px\" \/><\/a><\/p>\n<h2><strong>Retrieve Sender for the email<\/strong><\/h2>\n<p style=\"text-align: justify;\">Sender of the email must be the user in the CDS environment. We will retrieve the System User record using \u2018List Records\u2019 step. We will use GUID of the user record in the next step.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-7.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24886 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-7.png\" alt=\"Send bulk emails using the Email Template\" width=\"630\" height=\"407\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-7.png 630w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-7-300x194.png 300w\" sizes=\"(max-width: 630px) 100vw, 630px\" \/><\/a><\/p>\n<h2><strong>Use \u2018SendTemplate\u2019 action<\/strong><\/h2>\n<p style=\"text-align: justify;\">This \u2018<strong>SendTemplate<\/strong>\u2019 action is used to send bulk email messages using the Email Template. To execute this in Power Automate we need to add \u201cPerform an unbound action\u201d step.<\/p>\n<p>This step requires below parameters,<\/p>\n<p style=\"text-align: justify;\"><strong>Action Name<\/strong>: Select \u2018<strong>SendTemplate<\/strong>\u2019 from the list of actions.<\/p>\n<p><strong>TemplateId<\/strong>: GUID of the Email Template. In the second step, we retrieved the email template, we can use following expression to get the GUID of the template. first(body(&#8216;GetEmailTemplate&#8217;)?[&#8216;value&#8217;])?[&#8216;templateid&#8217;]\n<p><strong>Sender: <\/strong>Entity object of the user. Need to pass in the following format, systemusers(&lt;guid of user&gt;). To read the guid from the \u2018List Records\u2019 step, I can use following expression, first(body(&#8216;GetSender&#8217;)?[&#8216;value&#8217;])?[&#8216;systemuserid&#8217;]\n<p><strong>Recipients<\/strong>: Here we need to pass array of entity objects. I have passed the variable where I stored the list of entity objects of all the contacts. This parameter accepts value in the below format<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-8.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24885 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-8.png\" alt=\"Send bulk emails using the Email Template\" width=\"422\" height=\"142\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-8.png 422w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-8-300x101.png 300w\" sizes=\"(max-width: 422px) 100vw, 422px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Regarding<\/strong>: Record is to be set as the \u2018Regarding\u2019 of the email. In my example, setting the \u2018Regarding\u2019 does not make sense as I am not sending emails regarding any specific entity record. But, the problem is this parameter is required and it accepts entity object only. Here, I have passed the user entity object. As the user cannot be set as a \u2018Regarding\u2019, generated emails will not have regarding set.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-9.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24884 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-9.png\" alt=\"Send bulk emails using the Email Template\" width=\"635\" height=\"321\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-9.png 635w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-9-300x152.png 300w\" sizes=\"(max-width: 635px) 100vw, 635px\" \/><\/a><\/p>\n<p>This is all we required to send bulk email messages.<\/p>\n<p>Now let us see what happens in the background. After we run the flow, a \u2018Bulk Email\u2019 system job gets created in the background. This job then creates and sends the email to all recipients separately.\u00a0 We can check the status in the system jobs as shown below<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24883 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10.png\" alt=\"Send bulk emails using the Email Template\" width=\"1167\" height=\"344\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10.png 1167w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10-300x88.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10-768x226.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10-1024x302.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-10-660x195.png 660w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/a><\/p>\n<p>If you have added 5 records in the Recipients then 5 separate emails will get sent to them.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24882 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11.png\" alt=\"Send bulk emails using the Email Template\" width=\"908\" height=\"251\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11.png 908w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11-300x83.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11-768x212.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-11-660x182.png 660w\" sizes=\"(max-width: 908px) 100vw, 908px\" \/><\/a><\/p>\n<p>This is how we can send bulk email messages even for a large set of records.<\/p>\n<p>Note: The <strong>SendTemplate<\/strong> action will not send emails to contact\/account\/lead if they opt-out for bulk email.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-12.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-24881 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-12.png\" alt=\"Send bulk emails using the Email Template\" width=\"344\" height=\"412\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-12.png 344w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/09\/Part-2-Send-an-email-using-the-Email-Template-12-250x300.png 250w\" sizes=\"(max-width: 344px) 100vw, 344px\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p style=\"text-align: justify;\">We can use Power Automate flow to send bulk email messages to a large set of recipients.<\/p>\n<h3 style=\"\"text-align: left;\"\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:13px;margin-bottom:20px\"><div class=\"su-heading-inner\">Automating repetitive processes has a multiplier effect on business productivity!<\/div><\/div><\/h3>\n<p><em>Power Apps helps expand automation capability to devices. Experts at <a href=\"\"https:\/\/bit.ly\/3WMUL73\"\" target=\"\"_blank\"\" rel=\"\"noopener\"\">Inogic- Professional Services<\/a><\/em>  assist organizations in implementing and maximizing value from PowerApps.<br \/>\nWrite to us at <a href=\"\"mailto:crm@inogic.com\"\" target=\"\"_blank\"\" rel=\"\"noopener\"\">crm@inogic.com<\/a> for a techno-functional consultation and apt guidance<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In our last blog, we saw how we could create Power Automate Flow to send an email using the Email Template. We used \u201cSendEmailFromTemplate\u201d action to send a single email. Now, in this blog, we will see how we can send bulk email messages using the Email Template. Let us say, we want to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/09\/power-automate-send-an-email-using-the-email-template-part-2\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,19,1985],"tags":[2007,728,1975,1989,1571,2080,2081],"class_list":["post-24879","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-power-automate","tag-dynamics-365-power-automate","tag-email-template","tag-power-automate","tag-power-automate-flows","tag-send-an-email-using-email-template","tag-send-email-in-bulk","tag-send-mass-email"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/24879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=24879"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/24879\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=24879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=24879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=24879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}