Overview

Skill Level: Intermediate

Step-by-step

  1. Syntax of the request and response XML for SaveMailing

    It is critical to understand that this API replaces the existing template if it exists (the lookup is based on MailingName element).

    Advanced features such as Dynamic Content, Relational Table, and Stored File assets are not currently supported in this version of the API. However, you can pass full HTML, personalization tags, and any references to externally hosted image URLs within that HTML body that gives a full range of wanted look and feel.

    Note: All elements are case sensitive to the spec.

    Operation <SaveMailing>
    Elements Header Defines all Mailing Template settings.
      Child Element MailingName The name of the new mailing template.
        MailingID Optional Specify the Template Id if you want to update an existing Template instead of creating a new one.
        Subject Subject of the Mailing Template
        ListID The ID of the database, contact list, or query that is used for the mailing template.
        FromName Specify Mailing “From Name” value.
        FromAddress Specify Mailing “From Address” value.
        ReplyTo Specify Mailing “Reply To Address” value.
        Visibility Defining the location of the saved mailing. Valid values are: 0 – Private 1 – Shared
        FolderPath Optional Specify the path of the folder to save the Mailing Template. Example:

    • FolderName/SubfolderName

    Example: If the folder structure looks like: Shared/MyNewsletters/August, and I want to store my template in the ‘August’ folder, then my FolderPath element would be: <FolderPath>MyNewsletters/August</FolderPath>’

    Note: Folder names are case sensitive. If this element is not specified, the Mailing Template is saved in top-level directory.
        Encoding Message encoding. Valid values are: 0 = Western European (iso-8859-1) 1 = Chinese (Simplified) 2 = Chinese (Traditional) 3 = Japanese (EUC) 4 = Japanese (Shift-JIS) 5 = Korean 6 = Unicode (utf8) 7 = Japanese (JIS)
        TrackingLevel The tracking level for the messages. Possible values are: 1 = None 2 = Opens Only 3 = Aggregate 4 = Unique
        ClickHereMessage Optional Specify this parameter to add the ‘click to view in browser’ link at the top of the email message. If you specify the parameter in your xml, it treats the value as True or False. Example: <ClickHereMessage>True</ClickHereMessage> or <ClickHereMessage>False</ClickHereMessage>
        IsCrmTemplate Optional Specify whether this template is being shared with the CRM integration. Valid values are:

    • true
    • false
        HasSpCrmBlock Optional Specify whether CRM Block is being used. Valid values are:

    • true
    • false
        PersonalFromName Optional Specify “From Name” Personalization.
        PersonalFromAddress Optional Specify “From Address” Personalization.
        PersonalReplyTo Optional Specify “Reply To Address” Personalization.
      MessageBodies Defines Mailing Body
      ChildElement HTMLBody

    Fully encapsulated HTML content that is used in the mailing body that is wrapped in a CDATA tag. Complete HTML tags (html, head, body) must be used in the content for HTMLBody.

     

    Note: Currently HTML Body supports Tracked Hyperlink, Non-Tracked Hyperlink, One Click Opt Out, Custom Opt Out and Click Stream Links. To define these values in this section, following attribute needs to be added in the anchor tag.
     

    Non-Tracked Hyper Link : xt=’SPNOTRACK’ Tracked Hyper Link : xt=’SPCLICK’ Click Stream : xt=’ SPCLICKSTREAM’ One Click Opt Out : xt=’ SPONECLICKOPTOUT’ Custom Opt Out: xt=’ SPCUSTOMOPTOUT’ Custom Click to View: xt=’SPCLICKTOVIEW’

    Example of Tracked Hyper link used: <a href=” xt=’SPCLICK’ name=’Link1′>IBM</a>

        AOLBody Optional Fully encapsulated AOL content that is used in the mailing body that is wrapped in a CDATA tag.
        TextBody Optional Fully encapsulated Text content that is used in the mailing body that is wrapped in a CDATA tag.
      ClickThroughs All click through elements is enclosed within this element. This Element is required if the HTML Body consists of any Hyperlinks.
      Child Element ClickThrough All click through elements is enclosed within this element.
        ChildElement ClickThroughName The name of the url that is specified in the HTML content.
          ClickThroughURL The target url that is specified in the link within the HTML body.

    Note: Specify following for one click opt-out and custom opt-out.
    • #SPONECLICKOPTOUT
    • #SPCUSTOMOPTOUT
          ClickThroughType

    Click through types. Supported values include:

    1 = Not Tracked

    2 = Regular Click Thru

    5 = Clickstream Link

    12 = Personalized Links

    14 = One-Click Opt Out

    19 = Custom Opt Out

    20 = Custom Click To View

      ForwardToFriend The Forward To Friend Link is currently not supported via API. However, the element is required to call the API.
      ChildElement Forward Type Valid value: 0 = Not Embedded
    Use Case #1 This example creates an email template that contains an HTML body, personalization, and an opt-out link:
    Example
    <Envelope>
    <Body>
    <SaveMailing>
    <Header>
    <MailingName>
    <![CDATA[Dummy Mailing template]]>
    </MailingName>
    <FromName>
    <![CDATA[Silverpop®]]>
    </FromName>
    <FromAddress>
    <![CDATA[info@ibm.com]]>
    </FromAddress>
    <ReplyTo>
    <![CDATA[info@ibm.com]]>
    </ReplyTo>
    <Visibility>0</Visibility>
    <FolderPath>Shared/SPOP/MarketingTemplate</FolderPath>
    <Subject>Subject of a Mailing</Subject>
    <TrackingLevel>4</TrackingLevel>
    <Encoding>6</Encoding>
    <ListID>1924132</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.ibmcom”>IBM</a> for more information.
    If you would like to no longer receive any emails from this campaign,
    click <a href=”#SPONECLICKOPTOUT” xt=”SPONECLICKOPTOUT” name=”OOLink”>here</a>t</p></body></html>]]>
    </HTMLBody>
    <AOLBody>
    <![CDATA[<html><head><title>Mailing</title></head><body><p>This is an Example of a Mailing body.
    Visit <a name=”Link1″ href=”http://www.ibm.com”>IBM</a> for more
    information.
    If you would like to no longer receive any emails from this campaign,
    click <a href=”#SPONECLICKOPTOUT” xt=”SPONECLICKOPTOUT” name=”OOLink”>here</a>t</p></body></html>]]>
    </AOLBody>
    </MessageBodies>
    <ClickThroughs>
    <ClickThrough>
    <ClickThroughName>
    <![CDATA[Link1]]>
    </ClickThroughName>
    <ClickThroughType>2</ClickThroughType>
    <ClickThroughURL>http://www.ibm.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>
    Example with Custom Click to View
    <Envelope>
    <Body>
    <SaveMailing>
    <Header>
    <MailingName><
    ![CDATA[Dummy Mailing template]]>
    </MailingName>
    <FromName><
    ![CDATA[IBM]]>
    </FromName>
    <FromAddress>
    <![CDATA[]]>
    </FromAddress>
    <ReplyTo>
    <![CDATA[]]>
    </ReplyTo>
    <Visibility>1</Visibility>
    <FolderPath>SPOP/MarketingTemplate</FolderPath>
    <Subject>Subject of a Mailing</Subject>
    <TrackingLevel>4</TrackingLevel>
    <Encoding>6</Encoding>
    <ListID>1924132</ListID>
    </Header>
    <MessageBodies>
    <HTMLBody>
    <![CDATA[<html><head><title>Mailing</title>
    </head><body><a name=’view’ xt=’SPCLICKTOVIEW’ href=’#SPCLICKTOVIEW’ target=’_blank’ style=’color:#03509e;’>
    View in browser</a><br><p>This is an Example of a Mailing body.
    Visit <a name=’Link1′ href=’http://www.ibm.com’>IBM</a> for more information.
    If you would like to no longer receive any emails from this campaign,
    click <a href=’#SPONECLICKOPTOUT’ xt=’SPONECLICKOPTOUT’ name=’OOLink’>here</a>t</p></body></html>]]>
    </HTMLBody>
    <AOLBody>
    <![CDATA[<html><head><title>Mailing</title></head><body><p>This is an Example of a Mailing body.
    Visit <a name=’Link1′ href=’http://www.ibm.com’>IBM</a> for more information.
    If you would like to no longer receive any emails from this campaign,
    click <a href=’#SPONECLICKOPTOUT’ xt=’SPONECLICKOPTOUT’ name=’OOLink’>here</a>t</p></body></html>]]>
    </AOLBody>
    </MessageBodies>
    <ClickThroughs>
    <ClickThrough>
    <ClickThroughName>
    <![CDATA[view]]>
    </ClickThroughName>
    <ClickThroughType>20</ClickThroughType>
    <ClickThroughURL>
    <![CDATA[#SPCLICKTOVIEW]]>
    </ClickThroughURL>
    </ClickThrough>
    <ClickThrough>
    <ClickThroughName>
    <![CDATA[Link1]]>
    </ClickThroughName>
    <ClickThroughType>2</ClickThroughType>
    <ClickThroughURL>http://www.ibm.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>
    Response <RESULT>
    Elements SUCCESS TRUE if successful
      MailingID The ID of the template that was created or updated.
    Example
    <ENVELOPE>
    <BODY>
    <RESULT>
    <SUCCESS>TRUE</SUCCESS>
    <MailingID>81284534</MailingID>
    </RESULT>
    </BODY>
    </ENVELOPE>

Join The Discussion

Your email address will not be published. Required fields are marked *