I need to send out triggerd Order Confirmations via ExactTarget.
So far i'm able to send a triggered email via the rest API with a single order line where i have the order details created in a Data Extension and fill these via the JSON I send.
{
"To": {
"Address": "xxxx@xxxx.xx",
"SubscriberKey": "xxxx@xxxx.xx",
"ContactAttributes": {
"SubscriberAttributes": {
"First Name": "Danny",
"ArticleID": "12345",
"ArticleDescription": "Object1",
"ArticleAmount": "2",
"ArticleSize": "XL",
"ArticlePrice": "4.00",
"OrderSubTotal": "6.00",
"OrderVat": "2.00",
"OrderTotal": "8.00"
}
}
}
}
Using %%ArticleID%% etc. I show these values in the mail body.
But what I want to send is something like:
{
"To": {
"Address": "xxxx@xxxx.xx",
"SubscriberKey": "xxxx@xxxx.xx",
"ContactAttributes": {
"SubscriberAttributes": {
"First Name": "Danny"
}
},
"OrderAttributes" : {
"OrderLines": {
"OrderLine" : {
"ArticleID": "12345",
"ArticleDescription": "Object1",
"ArticleAmount": "2.00",
"ArticleSize": "x",
"ArticlePrice": "4.00"
},
"OrderLine" : {
"ArticleID": "5678",
"ArticleDescription": "Object2",
"ArticleAmount": "1.00",
"ArticleSize": "",
"ArticlePrice": "1.00"
}
},
"OrderSubTotal": "4.00",
"OrderVat": "1.00",
"OrderTotal": "5.00"
}
}
}
and use this info to create a table with all orderlines and price summary to display in the mailbody.
Any suggestions on how to accomplish this via the REST API? Is using DataExtensions the right approach or should I pre-build a htmlcode block and include that as a single replacement string in the mail?