The Smarty utility addSendProperties
allows you to add key/value pairs to the properties object of system events related to the message contact ID (message-sent, open, click, bounce, etc.).
As a best practice, it is recommended that the data object be built first and then passed via the addSendProperties
utility. Debugging can be used to preview the call and resolve any issues before the call is made.
Our example:
{* Build a data object *} {$data.send_properties = ['foo' => 'bar', 'foo2' => 'bar2']} {* Pass it into the method *} {$utils->addSendProperties($data.send_properties)} {* Debug *} {$debug = 1} {if $debug == 1} {$utils->jsonPrettyPrint($data)} {/if}
This example will add key/values pairs to the properties object of the system event:
{$utils->addSendProperties(["foo"=>"bar","foo2"=>"bar2"])}
The resulting properties object:
"properties":{ "foo":"bar", "foo2":"bar2" }
You may also add a dynamic value to the properties object. This example will add key/values pairs to the properties object of the system event (where dynamicValue is "biz"):
{$dynamicValue = 'biz'} {$utils->addSendProperties(["foo"=>"bar","dynamicValue"=>{$dynamicValue}])}
The newly defined dynamic value within the properties object:
"properties":{ "foo":"bar", "dynamicValue":"biz" }
Comments
0 comments
Please sign in to leave a comment.