Insert or update customer record and attributes
Overview
This scenario is a combination of the previous two. We show how to insert or update customer master data and customer attributes without sending an email
XML
<?xml version="1.0" encoding="UTF-8"?><kanaRoot> <EventRequest Id="" CompanyName="default" CampaignName="camp1"> City="Menlo Park" State="CA" SendEmail="false" 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, then a new record is added and populated with the accompanying customer data. If the customer already exists, then the row is updated with the corresponding customer data.
For each <CustomerAttribute> a new record is added to the CUST_ATTRIBUTES table. If the customer already has these attributes, they are updated.
The CUST_SUBSCRIPTION table is left alone.
Note: If the attributes have not been defined, the Event Listener will reject the XML message.
A new row is inserted into the EVENT_QUEUE table with status_code = 3 (handled) for each <Customer> element.
No email is sent.