If your creative team stores content in your content management system (CMS), you can programmatically pass it into an email using APIs. You can also use dynamic content rulesets.
To insert content, including dynamic content, from a CMS into an email, complete the following steps.
- Use the
SaveMailing
API to insert into a template the required personalization tags for a dynamic content ruleset%%dc::<your ruleset name>%%
. - Do either of the following steps:
- To create a dynamic content rule as if it were built in the classic rule builder, use
AddDCRuleset
. Use the Mailing ID and set the name of the dynamic content ruleset to be the same as what you specified in the email template as part of theSaveMailing
API. - To import a .zip file that contains the XML file that defines the dynamic content rules, use
ImportDCRuleset
. Make sure that the ruleset name matches what is in the email template and include the Mailing ID.
- To create a dynamic content rule as if it were built in the classic rule builder, use
The following example shows how to use the SaveMailing
API:
<Envelope> <Body> <SaveMailing> <Header> <MailingName><![CDATA[DC Test 1]]></MailingName> <FromName><![CDATA[Yourcompany]]></FromName> <FromAddress><![CDATA[mailto:someaddress@somedomain.com]]></FromAddress> <ReplyTo><![CDATA[mailto:someaddress@somedomain.com]]></ReplyTo> <Visibility>0</Visibility> <Subject>Subject of a Mailing</Subject> <TrackingLevel>4</TrackingLevel> <Encoding>6</Encoding> <ListID>123456</ListID> </Header> <MessageBodies> <HTMLBody><![CDATA[<html> <head> <title>Mailing</title> </head> <body> <p>This is an Example of a Mailing body. Visit <a name='Link1' href=''http://www.yourcompany.com">Yourcompany</a> for more information</p> <p>This is the DC:</p><p>%%DC::primary::DC%%</span></p> <p>If you would like to no longer recieve any emails from this campaign, click <a href='#SPONECLICKOPTOUT' xt='SPONECLICKOPTOUT' name='OOLink'>here</a>t</p> </body> </html>]]></HTMLBody> </MessageBodies> <ClickThroughs> <ClickThrough> <ClickThroughName><![CDATA[Link1]]></ClickThroughName> <ClickThroughType>2</ClickThroughType> <ClickThroughURL>"http://www.yourcompany.com"</ClickThroughURL> </ClickThrough> <ClickThrough> <ClickThroughName><![CDATA[OOLink]]></ClickThroughName> <ClickThroughURL><![CDATA[#SPONECLICKOPTOUT]]></ClickThroughURL> <ClickThroughType>14</ClickThroughType> </ClickThrough> </ClickThroughs> <ForwardToFriend> <ForwardType>0</ForwardType> </ForwardToFriend> </SaveMailing> </Body> </Envelope>