Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ELSEIF RequestParameter("submitted") == true AND RequestParameter("sub") == true THEN
/* update contact in Sales Cloud */
SET @updateRecord = UpdateSingleSalesforceObject(
"Contact", @contactId,
"FirstName", RequestParameter("firstname"),
"LastName", RequestParameter("lastname"),
"Email", RequestParameter("email"),
"Newsletter__c", "true",
"Events__c", "true",
"Offers__c", "true",
"HasOptedOutOfEmail", "false"
)
/* set subscriber status to active in All Subscribers */
SET @email = RequestParameter("email")
SET @Subscriber = CreateObject("Subscriber")
SetObjectProperty(@Subscriber, "SubscriberKey", @contactId)
SetObjectProperty(@Subscriber, "EmailAddress", @email)
SetObjectProperty(@Subscriber, "Status", "Active" )
SET @Status = InvokeUpdate(@Subscriber, @createErrDesc, @createErrNo, @createOpts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment