Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SendEmailFromTemplate with datafield through web api

(0) ShareShare
ReportReport
Posted on by

Hi. I'm trying to send an email through web api using the action SendEmailFromTemplate and I need passing data fields to replace in template. I'm sending a json like this:

{

      "TemplateId": "0B57FBB1-9C28-E911-A95E-000D3ABA65FD",
      "Regarding": {
            "accountid": "46d64005-4231-e911-a960-000d3aba6189",
            "@odata.type": "Microsoft.Dynamics.CRM.account"
      },
      "Target": {
      "email_activity_parties": [
            {
                  "partyid_systemuser@odata.bind": "/systemusers(4adb50e5-72bd-40a8-8021-d23c6462f32d)",
                  "participationtypemask": 1
            },
            {
                  "participationtypemask": 2,
                  "partyid_eve_inquilinos_reserva@odata.bind": "/account(293f3a4e-8b30-e911-a95e-000d3aba65fd)"
            }
      ],
      "@odata.type": "Microsoft.Dynamics.CRM.email"
      }
}

This json works fine and I send an email, but if I want sending data field to replace in template. Where do I have to put the data field in the json? Inside the target section? What format should it take? Is it possible this action?

Thanks

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: SendEmailFromTemplate with datafield through web api

    Thank you Rawish. I referenced the record in "Regarding" section and it works

  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at
    RE: SendEmailFromTemplate with datafield through web api

    Hi Adrian,

    Afaik , you dont need to set those fields - they are dynamics.

    as soon you send email using template - all those values are taken from the "Regarding" field record of the email which is being sent.

    are you seeing anything different?

    P.S

    if you have not - you have to go to the email template and add those field reference dynamically.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans