Embedding Attachments in XML Event Records
Inline Attachments
A second method for creating a campaign with dynamic attachments is to embed the attachments into the campaign's KCXML. See the Send message with inline attachmentstopic for an example of a campaign with embedded attachments.
A sample XML event record with embedded attachments is shown below:
<?xml version=
"1.0"
encoding=
"ISO-8859-1"
?>
<kanaRoot>
<EventRequest Id=”
12345
” CompanyName=”Default”>
<Customer KeyField=”EmailAddress” EmailAddress=”connect
@kana
.com” BirthDate=”
111
”>
<CustomerAttribute Name=
"First Name"
>John</CustomerAttribute>
<CustomerAttribute Name=
"Last Name"
>Smith</CustomerAttribute>
<CustomerPreference Name=
"Favorite River"
>
<CustomerPreferenceValue>Amazon</CustomerPreferenceValue>
<CustomerPreferenceValue>Yangtze</CustomerPreferenceValue>
</CustomerPreference>
</Customer>
<Event CampaignName=
"EToy Event"
>
<EventAttribute Name=
"Product"
>Dell Computer</EventAttribute>
<EventAttribute Name=
"Price"
>
300
</EventAttribute>
<EventAttribute Name=
"Date Of Purchase"
>
802390
</EventAttribute>
<ExternalXML>
<ORDER NO=
"1"
>
<SHIPPING TYPE=
"UPGRADE"
CARRIER=
"FEDEX"
TRACKNUMBER=
"8201280912"
>
<DATE DAY=
"15"
MONTH=
"05"
YEAR=
"2000"
/>
</SHIPPING>
<ITEMLIST>
<ITEM NUMBER=
"1"
QTY=
"2"
PRODUCTDESC=
"Tele Tubby pink"
STATUS=
"CA"
WEBSITEID=
"2"
FUNDS=
"100"
/>
<ITEM NUMBER=
"2"
QTY=
"4"
PRODUCTDESC=
"Tele Tubby blue"
STATUS=
"NONFINAL"
WEBSITEID=
"1"
FUNDS=
"200"
/>
<ITEM NUMBER=
"3"
QTY=
"1"
PRODUCTDESC=
"GI Joe"
STATUS=
"SH"
WEBSITEID=
"1"
FUNDS=
"0"
/>
<ITEM NUMBER=
"4"
QTY=
"1"
PRODUCTDESC=
"Bennie Baby"
STATUS=
"CA"
WEBSITEID=
"2"
FUNDS=
"0"
/>
<ITEM NUMBER=
"5"
QTY=
"5"
PRODUCTDESC=
"Bennie Baby"
STATUS=
"NONFINAL"
WEBSITEID=
"2"
FUNDS=
"150"
/>
</ITEMLIST>
</ORDER>
</ExternalXML>
<EventAttachments>
<EventAttachment Name=”statement.pdf”
url=http:
//contentserver/stmt?c=xcdsd=dec2008 />
<EventAttachment Name=”privacy-policy.pdf” Purge=
"yes"
Encoding=”base64”>Asjdfhififwdd923849238swedlkwajed0293802</EventAttachment>
</EventAttachments>
</Event>
</EventRequest>
</kanaRoot>
Purging Attachments after Message Execution
Binary attachments stored in Connect can be purged after the message is sent. Use the Purge attribute in the binary attachment definition in the KCXML.