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"); | |
try { | |
//fetch posted data | |
var jsonData = Platform.Request.GetPostData(); | |
var obj = Platform.Function.ParseJSON(jsonData); | |
//prepare data for API call | |
var base64enc = obj.base64enc; | |
var fileName = obj.fileName; |
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") == "import" THEN | |
SET @CampaignID = RequestParameter("Campaign") | |
IF NOT EMPTY(@CampaignID) THEN | |
SET @Campaign = RetrieveSalesforceObjects("Campaign","Id,Name","Id", "=", @CampaignID) |
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 @firstName = AttributeValue("FirstName") | |
if empty(@firstName) then | |
InsertDE("RaiseErrorLog", "JobID", jobid, "EmailName", emailname_, "SubscriberKey", _subscriberkey, "EmailAddress", emailaddr) | |
RaiseError("Missing first name", true, 1) | |
else | |
set @greeting = @firstName | |
endif | |
]%% |
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 @firstName = AttributeValue("FirstName") | |
if empty(@firstName) then | |
RaiseError("First name missing", true) | |
else | |
set @greeting = @firstName | |
endif | |
]%% | |
<p>Dear %%=v(@greeting)=%%,</p> |
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 @firstName = AttributeValue("FirstName") | |
if empty(@firstName) then | |
set @greeting = "Valued Customer" | |
else | |
set @greeting = @firstName | |
endif | |
]%% | |
<p>Dear %%=v(@greeting)=%%,</p> |
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
%%[ | |
var @rr, @sfp, @lists, @status | |
SET @rr = CreateObject("RetrieveRequest") | |
SetObjectProperty(@rr,"ObjectType","List") | |
AddObjectArrayItem(@rr,"Properties","ID") | |
AddObjectArrayItem(@rr,"Properties","ListName") | |
SET @sfp = CreateObject("SimpleFilterPart") | |
SetObjectProperty(@sfp,"Property","Type") | |
SetObjectProperty(@sfp,"SimpleOperator","equals") |
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
<!--–– Copyright © 2020 Zuzanna Jarczynska http://sfmarketing.cloud ––--> | |
<script runat="server"> | |
Platform.Load("Core","1.1.1"); | |
try{ | |
</script> | |
%%[ | |
SET @contactId = _subscriberkey | |
IF NOT EMPTY(@contactId) THEN |
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
/* update email in All Subscribers list */ | |
IF RequestParameter("email") != AttributeValue("emailaddr") THEN | |
SET @email = RequestParameter("email") | |
SET @Subscriber = CreateObject("Subscriber") | |
SetObjectProperty(@Subscriber, "SubscriberKey", @contactId) | |
SetObjectProperty(@Subscriber, "EmailAddress", @email) | |
SET @Status = InvokeUpdate(@Subscriber, @createErrDesc, @createErrNo, @createOpts) | |
ENDIF |
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
<!--–– Copyright © 2020 Zuzanna Jarczynska http://sfmarketing.cloud ––--> | |
%%[ | |
SET @contactId = _subscriberkey | |
IF NOT EMPTY(@contactId) THEN | |
/* fetch data from Sales Cloud to show in the form */ | |
SET @subscriberRows = RetrieveSalesforceObjects( |
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
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", |