Hello,
I wanted to know if it is possible to send an email template including an attachment dynamically by performing the unbound action "SendEmailFromTemplate" in Power Automate cloud flows.
This amazing blog post covers what I am looking for:
https://linnzawwin.blogspot.com/2022/10/generate-document-from-word-template.html?sc=1680760985532#c4723434891612517795
However, the only difference is that my email templates are in the "Email Template table" which already includes subject, body, and personalization variables included dynamically.
The below action can be used to create a draft email:
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/instantiatetemplate?view=dataverse-latest
I am still stuck on how to build the below on Power Automate:
1. Creating Draft Email (From InstantiateTemplate action)
2. Creating the attachment and adding an attachment to the notes
3. Sending the email
Can you please show a small example of how to achieve that?
Any help is greatly appreciated.
EBMRay
Hi EBMRay,
Refer to the following steps to create draft Emails (From InstantiateTemplate action) in power automate:
1.Get the email template ID you need:
--My example email template:
2.Perform an unbound action--InstantiateTemplate:
--ObjectType: Logical name of the entity in the email template category
--ObjectId: Email templates are based on which record is inserted(in my example, i want to apply template based on one contact(To field)--Leah Ju)
3.Compose--Get body of the action:
4.Parse JSON
https://www.m365princess.com/blogs/2021-02-08-how-to-use-parse-json-action-in-power-automate/
{
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"subject": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"@@odata.type",
"subject",
"description"
]
}
}
}
}
5.Add a new row
--Apply to each action will be added automatically after setting subject and description
Now you can add attachments and send emails on power automate (just as described in the first blog you provided).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156