Update Customer Attributes and Send Message
Overview
This scenario creates an event to insert or update a customer’s master data and attributes, then send an email to the customer.
XML
Note: The XML in this scenario has the campaign name in the EventRequest element and has no Event child element with ExternalXML. In this case, the Event Listener creates an event for the camp1 campaign with no ExternalXML. If the campaign expects XML, the content may look wrong if the XSL was not designed to handle a message with no ExternalXML.
<?xml version="1.0" encoding="UTF-8"?><kanaRoot> <EventRequest Id="" CompanyName="default" CampaignName="camp1"> City="Menlo Park" State="CA" Subscription="ignore"> <CustomerAttribute name="Favorite Color">red</CustomerAttribute> <CustomerAttribute name="Occupation">chef</CustomerAttribute> </Customer> </EventRequest> </kanaRoot> Result
If the customer with the email address, [email protected], does not exist in the CUSTOMER_MASTER table, a new record is inserted and populated with the accompanying customer data. If the CUSTOMER_MASTER row already exists, then the row is updated with the corresponding customer data. For each <CustomerAttribute> element, a new record is inserted into the CUST_ATTRIBUTES table. If the customer already has these attributes, they are updated instead.
Note: If the attributes are not defined, the Event Listener rejects the XML message.
A new row is inserted into the EVENT_QUEUE table with status_code = 1 (new) for each <Customer> element.
An email is sent.