web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at

    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.

  • Verified answer
    Community Member Profile Picture
    on at

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans