This file contains 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
/* ************************************ | |
- Salesforce Marketing Cloud Personalization (formerly Interaction Studio, formerly Evergage) | |
- External Email Campaign Events ETL | |
- https://help.salesforce.com/s/articleView?id=sf.mc_pers_etl_external_email_campaign_events_data_feed.htm&type=5 | |
************************************ */ | |
SELECT | |
sub.emailAddress AS [attribute:emailAddress], | |
s.SubscriberID AS [attribute:sfmcSubscriberID], | |
j.EmailID AS [externalCampaignId], |
This file contains 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
/* | |
One use, if your system snippet is directed to a custom cloud page, use the below instead | |
of [%%=RedirectTo(CloudPagesURL(##))=%%]. Without, there may be an error when using | |
parameter manager. This will avoid generating two question marks in the URL. | |
*/ | |
%%=RedirectTo(Concat(CloudPagesURL(##),SUBSTRING('?',1,0)))=%% |
This file contains 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
// SFMC source doc: https://help.salesforce.com/s/articleView?id=sf.mc_cp_cloud_pages_security_best_practices.htm&type=5 | |
// CSP page for other examples: https://content-security-policy.com/ | |
// standard example from doc | |
<script runat=server> | |
Platform.Response.SetResponseHeader("Strict-Transport-Security","max-age=200"); | |
Platform.Response.SetResponseHeader("X-XSS-Protection","1; mode=block"); | |
Platform.Response.SetResponseHeader("X-Frame-Options","Deny"); | |
Platform.Response.SetResponseHeader("X-Content-Type-Options","nosniff"); | |
Platform.Response.SetResponseHeader("Referrer-Policy","strict-origin-when-cross-origin"); |
This file contains 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
// populate with ampscript | |
%%[ | |
/* Replace 'thisIsTheSourceDe' with the actual name of your data extension */ | |
var @dataExtensionName | |
set @dataExtensionName = "thisIsTheSourceDe" | |
/* Replace 'myCustomerKey' with the actual field name you want to populate */ | |
var @fieldName | |
set @fieldName = "myCustomerKey" |
This file contains 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
// Name AND customer key of DE are: thisIsTheSourceDe | |
// Field in the above DE is: myCustomerKey (text) | |
// https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionFieldsAdd.html | |
<script runat="server"> | |
Platform.Load("core", "1"); | |
var api = new Script.Util.WSProxy(); | |
try { |
This file contains 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
// Originally found: https://salesforce.stackexchange.com/questions/271607/createsalesforceobject-ampscript | |
<script runat="server"> | |
Platform.Load("Core","1.1.1"); | |
try{ | |
</script> | |
%%[ YOUR AMPSCRIPT CODE ]%% | |
<script runat="server"> |
This file contains 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 @finalState = deStateValue | |
]%% | |
<form id="SubmitRegistration" action="%%=CloudPagesURL('111')=%%" method="post"> | |
<select class="inputBox state" id="" name="formState" title="State" %%=IIF(EMPTY(@finalState),'','disabled')=%%> | |
<option value="">--</option> | |
<option value="Alabama" %%=IIF(@finalState == 'AL','Selected','')=%%>Alabama</option> | |
<option value="Alaska" %%=IIF(@finalState == 'AK','Selected','')=%%>Alaska</option> |
This file contains 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"); | |
var records = DataExtension.Init("DeNameToGetValues"); | |
var data = records.Rows.Retrieve({Property:"run",SimpleOperator:"equals",Value:1}); // DE should have a field called 'run' that is boolean to filter. | |
var datalength = data.length; | |
for (var i = 0 ; i < data.length ; i ++) { | |
var sf_fieldUpdateString = []; | |
sf_fieldUpdateString.push(data[i].SubscriberKey); |
This file contains 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 @CheckForEmail = IsEmailAddress(_SubscriberKey) | |
IF @CheckForEmail == 'false' THEN | |
SET @FinalSubscriberKey = _SubscriberKey | |
ELSE | |
SET @FinalSubscriberKey = SHA256(_SubscriberKey,'UTF-16') | |
ENDIF | |
SET @Link = CONCAT('https://[DomainStuffHere]?mcsubkey=', @FinalSubscriberKey) |
This file contains 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
<!-- toggles checkboxes on and off with jquery. If one check box changes (mainsub), then the other checkboxes (interest) change. | |
<html> | |
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script> | |
<body> | |
<input type="checkbox" class="interest" /> | |
<input type="checkbox" class="interest" /> | |
<input type="checkbox" class="interest" /> | |
<input type="checkbox" class="mainsub" /> | |
<span id="message">this is a message!</span> |
NewerOlder