This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com | |
POST /interaction-experimental/v1/batchcontactevents | |
Content-Type: application/json | |
Authorization: Bearer YOUR_V1_ACCESS_TOKEN | |
{ | |
"EventDefinitionKey":"{{API entry event key}}", | |
"BatchId":"", | |
"RecordCount":2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*****2020-11-12 16:51:04.337|HTTP RESPONSE|"6ffc2d53-c97e-4a89-bd66-535cxxxxx" | |
*****2020-11-12 17:02:29.36|HTTP CALLOUT|FireJourneyBuilderEvent | |
*****2020-11-12 17:02:29.46|HTTP REQUEST|https://mcxxxxx.rest.marketingcloudapis.com/interaction-experimental/v1/batchcontactevents | |
{ | |
"EventDefinitionKey":"SalesforceObjcbd44d55f8f9df29b0f5631xxxxxx", | |
"ContactPersonType":"CampaignMember", | |
"CallerSystemName":"Salesforce", | |
"BatchId":"", | |
"RecordCount":2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
Platform.Load("Core","1.1.1"); | |
try{ | |
</script> | |
%%[ | |
IF RequestParameter("submitted") == true THEN | |
SET @preferences = CONCAT( | |
Iif(RequestParameter("newsletters") == "on", "Newsletters;", ""), | |
Iif(RequestParameter("events") == "on", "Events;", ""), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @preferences = CONCAT( | |
Iif(RequestParameter("newsletters") == "on", "Newsletters;", ""), | |
Iif(RequestParameter("events") == "on", "Events;", ""), | |
Iif(RequestParameter("offers") == "on", "Special Offers;", ""), | |
Iif(RequestParameter("surveys") == "on", "Surveys;", ""), | |
Iif(RequestParameter("promotions") == "on", "Promotions", ""), | |
) | |
if not Empty(@preferences) then | |
SET @updateRecord = UpdateSingleSalesforceObject( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
set @subscriberKey = AttributeValue(_subscriberKey) | |
set @subscriberRows = RetrieveSalesforceObjects( | |
"Contact", | |
"FirstName,LastName,Email,Preferences__c", | |
"Id", "=", @subscriberKey ) | |
if RowCount(@subscriberRows) == 1 then /* there should only be one row */ | |
var @subscriberRow, @firstName, @lastName, @email | |
set @subscriberRow = Row(@subscriberRows, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Please fill in the form:</h2> | |
<form action="%%=RequestParameter('PAGEURL')=%%" method="post"> | |
<label>First name: </label><input type="text" name="firstname" required="" value="%%=v(@firstName)=%%"><br> | |
<label>Last name: </label><input type="text" name="lastname" required="" value="%%=v(@lastName)=%%"><br> | |
<label>Email: </label><input type="text" name="email" required="" value="%%=v(@email)=%%"><br><br> | |
<h2>Update your subscriptions:</h2> | |
<input name="newsletters" type="checkbox" %%=v(@Newsletters)=%%><label>Newsletters</label><br> | |
<input name="events" type="checkbox" %%=v(@Events)=%%><label>Events</label><br> | |
<input name="offers" type="checkbox" %%=v(@Offers)=%%><label>Special Offers</label><br> | |
<input name="surveys" type="checkbox" %%=v(@Surveys)=%%><label>Surveys</label><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="checkbox" checked> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
set @subscriberKey = AttributeValue(_subscriberKey) | |
set @subscriberRows = RetrieveSalesforceObjects( | |
"Contact", | |
"FirstName,LastName,Email,Preferences__c", | |
"Id", "=", @subscriberKey ) | |
if RowCount(@subscriberRows) == 1 then /* there should only be one row */ | |
var @subscriberRow, @firstName, @lastName, @email | |
set @subscriberRow = Row(@subscriberRows, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
set @subscriberKey = AttributeValue(_subscriberKey) | |
set @subscriberrows = retrievesalesforceobjects( | |
"contact", | |
"firstname,lastname,email,preferences__c", | |
"id", "=", @subscriberKey) | |
if rowcount(@subscriberrows) == 1 then | |
set @subscriberrow = row(@subscriberrows, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
set @subscriberKey = AttributeValue(_subscriberKey) | |
set @subscriberrows = retrievesalesforceobjects( | |
"contact", | |
"firstname,lastname,email,preferences__c", | |
"id", "=", @subscriberKey) | |
if rowcount(@subscriberrows) == 1 then | |
set @subscriberrow = row(@subscriberrows, 1) |