Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Table of Contents:

The Transactional Injection Feed

While the feeds in the previous section: Ongage Feeds: HTML, RSS, XML and JSON use a URL to retrieve dynamic content from an external content/web server to populate outgoing email messages, with this feature you can specify the dynamic feed directly within the Transactional API call. 

Use Cases

A powerful feature for eCommerce and travel

This is a powerful feature for eCommerce and travel sites. With it one can send transactional emails of purchase summaries (e.g., purchase line items) or reservations details (e.g., hotel, room, itinerary line items, etc.).

The feature enables marketers to use the same email message, yet each recipient will get a tailor message of their reservation details, or purchase summaries, based on the dynamic content values in the feed. These API calls with their tailor feeds are generated from data in a back-end CRM/Accounting/Reservation platform. 

Setup Required to send Transactional emails using an API Injection Feed

Email Message

Your email message needs to include List Dynamic as well Feed Dynamic field which you are going to populate through the Transactional API Request.

For example here is how your email message will look like.

Please note how the email message includes "{{ocx_feed{param=dynamic_feed}}}" where the param=dynamic_feed replaces the content URL and it will be used to add XML as parameter in API request.


The XML FEED

For any particular contact, the XML feed to populate content in above email message will look like below.

<feed>
  <mailing>
    <blocks>
      <block>
        <name>blockName</name>
        <items>
          <item>
            <variables>
              <variable>
                <key>title</key>
                <value>Your Order Confirmation</value>
              </variable>
              <variable>
                <key>classSummary</key>
                <value>Here goes the summary of transaction</value>
              </variable>
              <variable>
                <key>classUrl</key>
                <value>www.domain.com/class/Destination-Link</value>
              </variable>
              <variable>
                <key>classAmount</key>
                <value>$123,123</value>
              </variable>
            </variables>
          </item>
        </items>
      </block>
    </blocks>
  </mailing>
</feed>


Transactional API Request

Finally, to send Transactional Email, you need to use POST /api/transactional/send End point. The example API request is shared below which includes Email Message ID and the XML feed as parameters.

{
"recipients":["abc@domain.com"],
"campaign_id":1234567890, 					// Transactional Campaign ID: If not used as parameter, Default Transactional Campaign will be used.
"message_id":1234567,						
"message_dynamic_fields":{
    "Customer_ID":"12345",
    "dynamic_feed":
    "<feed>
	<mailing>
		<blocks>
			<block>
				<name>blockName</name>
				<items>
					<item>
						<variables>
							<variable>
								<key>title</key>
								<value>Your Order Confirmation</value>
							</variable>
							<variable>
								<key>classSummary</key>
								<value>Here goes the summary of transaction</value>
							</variable>
							<variable>
								<key>classUrl</key>
								<value>www.domain.com/class/Destination-Link</value>
							</variable>
							<variable>
								<key>classAmount</key>
								<value>$123,123</value>
							</variable>
						</variables>
					</item>
				</items>
			</block>
		</blocks>
	</mailing>
	</feed>"
    }
}


(warning)Note: Please note that the "blockName" in Email Message (as block=blockName) and in XML Feed added in API request has be same (Case Sensitive).

For the above setup, the transactional Email received in Inbox will look similar to screenshot shared below.

Additional Notes

  1. The List Field value added in API request above under "message_dynamic_fields" will overwrite the value stored in List field of any contact while sending the Transactional Emails only. The original value stored in list field will still remain as it is after the API request.
  2. You can also use IF-THEN-ELSE conditions in the email message and send dynamic content to end users based on the List field value either populated in API request or already stored in List.



  • No labels