[SalesForce] Triggered Send using REST API with Data Extension

I would like to substitute some variables in my email template using SFMC's REST API.

For example, in my email:

%%[Substitute_var1]%%

When I call it through REST, how it's possible to substitute this variable?

Best Answer

The REST call to send a triggered message does not provide the ability to update a data extension. It does allow you to update "send time attributes' for a subscriber, and those are passed in as the to: section of the payload:

  "To":{
     "Address":"example1@example.com",
     "SubscriberKey":"example1@example.com",
     "ContactAttributes":{
        "SubscriberAttributes":{
           "Region":"West", //passed in at send time
           "City":"Indianapolis", //passed in at send time
           "Substitute_var1":"Value" //passed in at send time
        }
     }
  }

These attributes for the subscriber will need to be created prior to sending.

Related Topic