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
| IF RequestParameter("submitted") == true AND RequestParameter("unsub") == true THEN | |
| /* update contact in Sales Cloud */ | |
| SET @updateRecord = UpdateSingleSalesforceObject( | |
| "Contact", @contactId, | |
| "Newsletter__c", "false", | |
| "Events__c", "false", | |
| "Offers__c", "false", | |
| "HasOptedOutOfEmail", "true" | |
| ) |
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 @contactId = _subscriberkey | |
| IF RequestParameter("submitted") == true THEN | |
| /* update contact */ | |
| SET @updateRecord = UpdateSingleSalesforceObject( | |
| "Contact", @contactId, | |
| "FirstName", RequestParameter("firstname"), | |
| "LastName", RequestParameter("lastname"), |
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 @contactId = _subscriberkey | |
| IF NOT EMPTY(@contactId) THEN | |
| /* fetch data from Sales Cloud to show in the form */ | |
| SET @subscriberRows = RetrieveSalesforceObjects( | |
| "Contact", | |
| "Id,FirstName,LastName,Email,Newsletter__c,Events__c,Offers__c,HasOptedOutOfEmail", |
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
| <html> | |
| <body> | |
| <h2>Update your profile:</h2> | |
| <form> | |
| <label>First name: </label><input type="text" name="firstname"><br> | |
| <label>Last name: </label><input type="text" name="lastname"><br> | |
| <label>Email: </label><input type="text" name="email"><br> | |
| <h2>Update your subscriptions:</h2> | |
| <label>Newsletter: </label><input name="newsletter" type="checkbox"><br> | |
| <label>Events: </label><input name="events" type="checkbox"><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
| HTTP/1.1 202 Accepted | |
| { | |
| "tokenId": "c21NCNSDN2sMMWM2miosdjEHH", | |
| } |
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 /sms/v1/messageContact/MzA6Nzg6MA/send | |
| Content-Type: application/json | |
| Authorization: Bearer YOUR_ACCESS_TOKEN | |
| { | |
| "mobileNumbers": [ | |
| "13175551212" | |
| ], | |
| "Subscribe": true, |
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 { | |
| //API authentication | |
| var authEndpoint = ""; //provide authentication endpoint | |
| var payload = { | |
| clientId: "", //provide Client Id | |
| clientSecret: "" //provide Client Secret | |
| }; |
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
| Dear Customer,<br> | |
| Here are the details of your order:<br> | |
| <script runat="server"> | |
| Platform.Load("core","1"); | |
| var custId = "0031t000005D98UAAS" | |
| var OrdersDE = DataExtension.Init("Orders"); | |
| var rows = OrdersDE.Rows.Lookup(["CustomerId"], [custId]); |
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"); | |
| var custId = "0031t000005D98UAAS" | |
| var OrdersDE = DataExtension.Init("Orders"); | |
| var rows = OrdersDE.Rows.Lookup(["CustomerId"], [custId]); | |
| if(rows.length >= 1) { | |
| for (i = 0; i < rows.length; i++) { | |
| OrderItem = rows[i]["OrderItem"]; |
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"); | |
| var custId = "0031t000005D98UAAS" | |
| var OrdersDE = DataExtension.Init("Orders"); | |
| var rows = OrdersDE.Rows.Lookup(["CustomerId"], [custId]); | |
| </script> |