/
NUTRINTG RTM (Realtime Messaging)

NUTRINTG RTM (Realtime Messaging)


Real time messages (RTM) or as it’s called Triggered Emails in Marketing Cloud is an email message sent to a customer in a response to a customer action. RB has a requirement to move RTM messages to SFMC, these can be welcome, order confirmation emails and etc.

Salesforce provides this functionality out of the box and makes API available to customer which can be leveraged in the transacting systems.

Main

Epsilon CDP trigger sending email by RTM message send to RB Middleware.

 RTM Message Dictionary:


Field nameField typeExample valueComment
emailAddressStringjohn@doe.com
customerKeyString3000003952033
individualIdString3000003952033
encryptedEmailAddressString212DA4BE8002F62712F5ECB7F3524F5D51E28ACEBB8914C5B8AC60E6330D50B4
firstNameStringJohn
lastNameStringDoe
cidStringDE100021651651
treatmentCodeStringABC1123XYZDefines what type of message is sent
profileIdStringefa9edb1-dcac-4323-a882-89b36cd1d8cd
accountSourceCodeStringUSAGWTUSC
dataSourceCodeString

6GLE1 - ENSPIRE SELF-ENROLLMENT

6GLE2 - ENSPIRE - PAID SEARCH

6GLE8 - ENSPIRE ENROLLMENT VIA DEST MAT EMAIL

6GLE9 - ENSPIRE ENROLLMENT VIA DEST MAT POSTCARD

MJNWP - MEAD JOHNSON WEB PROFILE UPDATE

MJTWP - TODDLER ENROLLMENTS FOR SAMPLE

NAP03 - NUTRAMIGEN ONLINE POWEROF2 IDENTIFIES RESPONDER

NAP04 - ENFACARE ONLINE DTT IDENTIFIES RESPONDER

not mandatory

brandOrgCodeStringMJNUSAC
createdStringIn format: MM/dd/yyyy HH:mm


 Schema of message:


 1 {
 2   "definitions": {},
 3   "$schema": "http://json-schema.org/draft-07/schema#",
 4   "$id": "http://example.com/root.json",
 5   "type": "array",
 6   "title": "The Root Schema",
 7   "items": {
 8     "$id": "#/items",
 9     "type": "object",
10     "title": "The Items Schema",
11     "required": [
12       "attributes",
13       "emailAddress",
14       "customerKey"
15     ],
16     "properties": {
17       "attributes": {
18         "$id": "#/items/properties/attributes",
19         "type": "array",
20         "title": "The Attributes Schema",
21         "items": {
22           "$id": "#/items/properties/attributes/items",
23           "type": "object",
24           "title": "The Items Schema",
25           "required": [
26             "attributeName",
27             "attributeType",
28             "attributeValue"
29           ],
30           "properties": {
31             "attributeName": {
32               "$id": "#/items/properties/attributes/items/properties/attributeName",
33               "type": "string",
34               "title": "The Attributename Schema",
35               "default": "",
36               "examples": [
37                 "CustomerKey"
38               ],
39               "pattern": "^(.*)$"
40             },
41             "attributeType": {
42               "$id": "#/items/properties/attributes/items/properties/attributeType",
43               "type": "string",
44               "title": "The Attributetype Schema",
45               "default": "",
46               "examples": [
47                 "String"
48               ],
49               "pattern": "^(.*)$"
50             },
51             "attributeValue": {
52               "$id": "#/items/properties/attributes/items/properties/attributeValue",
53               "type": "string",
54               "title": "The Attributevalue Schema",
55               "default": "",
56               "examples": [
57                 "3000003952033"
58               ],
59               "pattern": "^(.*)$"
60             }
61           }
62         }
63       },
64       "emailAddress": {
65         "$id": "#/items/properties/emailAddress",
66         "type": "string",
67         "title": "The Emailaddress Schema",
68         "default": "",
69         "examples": [
70           "john@doe.com"
71         ],
72         "pattern": "^(.*)$"
73       },
74       "customerKey": {
75         "$id": "#/items/properties/customerKey",
76         "type": "string",
77         "title": "The Customerkey Schema",
78         "default": "",
79         "examples": [
80           "3000003952033"
81         ],
82         "pattern": "^(.*)$"
83       }
84     }
85   }
86 }


 Example message:


[
	{
		"attributes": [
			{
				"attributeName": "individualId",
				"attributeType": "String",
				"attributeValue": "3000003952033"
			},
			{
				"attributeName": "emailAddress",
				"attributeType": "String",
				"attributeValue": "John@doe.com"
			},
			{
				"attributeName": "encryptedEmailAddress",
				"attributeType": "String",
				"attributeValue": "212DA4BE8002F62712F5ECB7F3524F5D51E28ACEBB8914C5B8AC60E6330D50B4"
			},
			{
				"attributeName": "emailName",
				"attributeType": "String",
				"attributeValue": "2016_Welcome_ECO_Newborn_English"
			},
			{
				"attributeName": "firstName",
				"attributeType": "String",
				"attributeValue": "John"
			},
			{
				"attributeName": "lastName",
				"attributeType": "String",
				"attributeValue": "Doe"
			},
			{
				"attributeName": "cid",
				"attributeType": "String",
				"attributeValue": "DE100021651651"
			},
			{
				"attributeName": "treatmentCode",
				"attributeType": "String",
				"attributeValue": "ABC1123XYZ"
			},
			{
				"attributeName": "profileId",
				"attributeType": "String",
				"attributeValue": "efa9edb1-dcac-4323-a882-89b36cd1d8cd"
			},
			{
				"attributeName": "accountSourceCode",
				"attributeType": "String",
				"attributeValue": "USAGWTUSC"
			},
			{
				"attributeName": "dataSourceCode",
				"attributeType": "String",
				"attributeValue": "USAGWTUSC"
			},
			{
				"attributeName": "brandOrgCode/ProgramCode",
				"attributeType": "String",
				"attributeValue": "MJNUSAC"
			},
			{
				"attributeName": "created",
				"attributeType": "String",
				"attributeValue": "01/20/2019 12:00"
			}
		],
		"emailAddress": "John@doe.com",
		"customerKey": "3000003952033"
	}
]


Old (original) version of RTM Mapping (Harmony to Salesforce)

Old version RTM Mapping (Harmony to SalesForce).xlsx



Message will be passed to Salesforce Marketing cloud by API.
Proper destination of message in Bussiness Unit and Data extension will be determined by Middleware based on BrandOrgCode as BU and AccountSourceCode as DE fields from list above.

Data Extension should include all fields mentioned in the RTM Message dictionary (top of the this page).

Simplified flow for this process.



Most important part of process is located in Message creation.
At this point proper BU and DE will be choosen.

Message will be stored as row in DE where will be configured email dispatch with customized templates and content.


https://www.lucidchart.com/documents/edit/7bcd7add-4356-46a9-9e94-180bf902be7b/0


Version presented on demo 05.03.2018:


Error handling

Validation

Validation of JSON from CDP: checking schema, datatype, length, required fields.

If validation failed, 400 status code with information what requirement has been violated should be returned.


Failure of sending message to SFMC (SOAP request)

If SFMC responses with error message (eg. SFMC email address is incorrect), error message should be written down to Queue.

Later we'll choose the best way to communicate these errors, whether it would be email or something else.


Salesforce side

Please see the Triggered Email documentation on setting this up in SFMC.

Also see the Transactional Messaging API documentation to trigger RTM messages.


Epsilon side

RTM criteria for both welcome RTMs for Enfamma Poland:

Poland RTM triggers:

  • PL_ENFAMAMA_WEL_PREGNANCY
    • Opts into POL_ENFAMAMA Subscription, EM Channel Code
    • Has a child not yet born (Birth Date after today)
    • Only one RTM will be triggered for this once per 90 days for the email address.  So if a user opts in today, receives an RTM, then re-opts in via some other source tomorrow (or the next 90 days), they would not receive an RTM.
  • PL_ENFAMAMA_WEL_POSTNATAL
    • Same a above rules, but child’s birth date must be today or earlier.