web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to send an email template with an attachment dynamically?

(0) ShareShare
ReportReport
Posted on by 905

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

I have the same question (0)
  • EBMRay Profile Picture
    905 on at

    Hello Steve Zhao2,

    I would highly appreciate your assistance regarding this topic.

    Thank you!

  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    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:

    pastedimage1681191570477v2.png

    2.Perform an unbound action--InstantiateTemplate:

    pastedimage1681191785637v4.png

    --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)

    pastedimage1681192236175v5.pngpastedimage1681192313116v6.png

    3.Compose--Get body of the action:

    pastedimage1681192427546v7.png

    4.Parse JSON

    https://www.m365princess.com/blogs/2021-02-08-how-to-use-parse-json-action-in-power-automate/ 

    pastedimage1681192514540v8.png

    {
        "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

    pastedimage1681192596933v9.png

    pastedimage1681192655701v10.png

    Now you can add attachments and send emails on power automate (just as described in the first blog you provided).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

#3
ManoVerse Profile Picture

ManoVerse 53 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans