%%#items%%
tag could be passed in as a table, or could be a simple list of items. Since API message tags are just empty place holders, they can be used for anything that you want to contain up to date/personalized information, or data you don't have at the time the message is designed.
Setup
So let's make sure you know how to pass this data in from the development side. If you take a look at the documentation for thewriteDeliveries
function, you will notice the optional fields parameter. This is an array of messageField
objects which contain the name of the field, the type, and the actual content. The type is the type of message for which the data is destined, not the type of the data. In some cases, the difference between the data you send into an HTML message and the data you send into the text version of the message will be different. A transactional purchase receipt, for instance, would likely contain a list of items purchased. The HTML version of the message might get an HTML table structure, while the text version of the message would get a simple comma separated list of items.
Passing In HTML
Wait a minute, HTML? That's right! You can pass in more than just a simple name of an item, or a purchase price. You can even make styling or formatting decisions at send time. You would probably want to leave most of the styling to your email designers, but clearly there is the opportunity to do a lot of interesting things with API message tags. Hopefully you can now see how useful API message tags are. If you have been using the API and wondered what these optional tags were, run to your nearest code editor or IDE and send some messages with personalized information courtesy of API message tags.
Alex Durzy
Support Engineer at Bronto