Overview

Skill Level: Intermediate

Step-by-step

  1. Syntax of the request and response XML for SendMailing

    You can automate a mailing to send after contacts successfully Opt In or Edit Profile using a Web form associated. You can also set automation for custom events, which are triggered by an API request. The SendMailing operation sends a mailing to the specified contact. The SendMailing operation is specifically for the delivery of autoresponders based on a custom event. This operation will not send a mailing Template. The Mailing ID must be for an existing, custom event autoresponder and the contact email address must be for a contact who already exists in the database associated with the mailing. See Add a Contact for information on adding a contact to a database. Each Send is queued for message generation and delivery. They do not always send immediately, but receive slices of processing time as determined by an algorithm. Small sends such as these are typically built and sent within a range of seconds‚Äźto‚Äźminutes, but that varies based on several factors such as concurrent system usage.

    Note: There is a limit of 10,000 SendMailing API calls per day for an Organization. If you plan to send more than 10,000 transactional emails per day, please contact your IBM account manager to discuss alternatives.

    Operation <SendMailing>      
    Elements MailingId Identifies the mailing Watson Campaign Automation will send.    
      RecipientEmail Identifies the targeted contact’s email address.    
      COLUMNS Optional XML nodes defining the column name and value for the database’s keyfields. Note: Each node must have a Name tag and a Value tag. If the databasehas a key that is not Email, Unique key columns must also be part of the submission with column names and values.    
      Child Element COLUMN  XML nodes defining the column name and value. Note: Eachnode must have a Name tag and a Value tag. If the database hasa key that is not Email, Unique key columns must also be part ofthe submission with column names and values.  
        Child Element Name Defines the field name.
          Value Contains the field value.
      LOOK_UP_KEYS Send an autoresponder message to a single contact that references a flexible database by providing a combination of unique values.    
        LOOK_UP_KEY    
        Child Element Name Defines the field name.
          Value Contains the field value.
    Example with Recipient Email
    <Envelope>
    <Body>
    <SendMailing>
    <MailingId>149482</MailingId>
    <RecipientEmail>t@domain.com</RecipientEmail>
    </SendMailing>
    </Body>
    </Envelope>
    Example with <COLUMNS> for non-email keyed databases
    <Envelope>
    <Body>
    <SendMailing>
    <MailingId>149482</MailingId>
    <COULMNS>
    <COLUMN>
    <NAME>CustomerID</NAME>
    <VALUE>00141</VALUE>
    </COLUMN>
    </COLUMNS>
    </SendMailing>
    </Body>
    </Envelope>
         
    Example with <LOOK_UP_KEYS> for flexible databases
    <Envelope>
    <Body>
    <SendMailing>
    <MailingId>149482</MailingId>
    <LOOK_UP_KEYS>
    <LOOK_UP_KEY>
    <NAME>UID</NAME>
    <VALUE>36912</VALUE>
    </LOOK_UP_KEY>
    <LOOK_UP_KEY>
    <NAME>Offer Id</NAME>
    <VALUE>1</VALUE>
    </LOOK_UP_KEY>
    </LOOK_UP_KEYS>
    </SendMailing>
    </Body>
    </Envelope>
           
    Example
    <Envelope>
    <Body>
    <RESULT>
    <SUCCESS>TRUE</SUCCESS>
    <ORGANIZATION_ID>123456</ORGANIZATION_ID>
    </RESULT>
    </Body>
    </Envelope>
    Response <RESPONSE>      
    Elements SUCCESS TRUE if successful. Upon success, the API immediately schedules a mailing to the contact.    
      ORGANIZATION_ID Identifies your Watson Campaign Automation Organization.    

    If using RecipientEmail, then neither LOOK_UP_KEYS nor COLUMNS is needed. 

    If using LOOK_UP_KEYS because of a flexible database of some kind, then COLUMNS wont work, and RecipientEmail isn’t needed.

    If using COLUMNS because of a keyed database of some kind, then LOOK_UP_KEYS wont work and RecipientEmail element isn’t needed.

6 comments on"Send a Mailing to a Contact"

  1. Is it possible I send an attachment?

  2. Devendra Yadav December 31, 2018

    Is it possible that I can send custom attribute in the send Mailing API which is not part of the connected database? Like there is no field in the database for team Name but I want to send the team name under the API. I have tried below solution but it’s not working.

    1234567
    xyz@xyz.com

    TEAM NAME
    Avengers

    • Hello Devendra,
      No, you would have to create a field in the database for the Team Name to be pulled into the mailing.

      Thank you
      Jeri

  3. Thanks for finally writing about >Send a Mailing to a Contact – Watson Customer Engagement
    | For Developers <Liked it!

  4. Michael A. Pusatera August 22, 2019

    How do we use this with Transact Campaigns?

Join The Discussion

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