4

I have a triggered email I’d like to pass a custom variable to. I’m triggering the email via the RESTful API and JSON.

I've tried inserting %%dateandtime%% and %%[dateandtime]%% into my email with JSON like so.

{
    "To": {
        "Address": "someone@internet.com",
        "SubscriberKey": "someone@internet.com",
        "dateandtime" : "May 5, 2017",
        "ContactAttributes": {
            "SubscriberAttributes": {

            }
        }
    },
    "OPTIONS": {
        "RequestType": "ASYNC"
    }
}

This doesn't seem to work. What do I need in my JSON and what token do I need to insert into my email? Is there something additional I need?

1
1

You should add/ update subscribers in All Subscribers or Data Extension first. Do this along With this custom attribute. Then your email will be able to pick it up.

Check the below link on how to insert in a data extension using REST API

Upserting Data Extension

Once records is loaded in the DE, refer them simply by %%columnname%% in the email

4
  • I created a data extension like so (imgur.com/12KvRnO). How do I reference this in my email and where should I pass it in my JSON?
    – Alex
    May 25 '16 at 13:50
  • I updated my answer. Hope that helps
    – Maneesh
    May 25 '16 at 14:17
  • What do you mean “once a record is loaded”? This data is coming into the API via JSON when I call exacttargetapis.com/messaging/v1/messageDefinitionSends/…. The %%dateandtime%% variable, that I would like to map to my Data Extension, is not available in my email. What do I have to do for this variable to appear in the dropdown list?
    – Alex
    May 26 '16 at 21:26
  • Hi Alex, that drop-down only shows the attributes from All Subscribers. It cannot source from a data extension. Let me ask this - This variable - %%dateandtime%% , Is this an attribute in your data extension or ALL Subscribers?
    – Maneesh
    May 31 '16 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.