Overview
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.).
Send properties must be added before the message is sent. It is not possible to add send properties to sent messages.
As a best practice, it's 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.
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" }
Send properties can be retrieved and rendered in a message via the getEventRecords method, but they are not available for identifying contacts using audience rules.
Comments
0 comments
Please sign in to leave a comment.