View sfmc-check-list-membership.amp
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
%%[ | |
var @isASubscriber, @sk, @row, @status, @listID | |
set @isASubscriber = 0 | |
/* ListID can be found in the List's Properties tab */ | |
set @listID = "111111" | |
/* Retrieve the SubscriberKey/EmailAddress */ | |
/* via URL Parameter: */ |
View sfmc-custom-preference-center-boilerplate.html
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" language="JavaScript"> | |
// src: https://gist.github.com/wvpv/19777e1167d6ac91e2e8 | |
// demo: https://pub.s7.exacttarget.com/yo3hzpktgmu?qs=7145718410d87e2af4e5001112e1de43e2e457b69041ac21&mid=7203368 | |
Platform.Load("core", "1"); | |
var debug = true; | |
var request = {}; |
View sfmc-triggered-send-soap-request-envelope.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"> | |
<s:Header> | |
<a:Action s:mustUnderstand="1">Create</a:Action> | |
<a:MessageID>urn:uuid:9037cc93-13f4-433b-b3f9-250ffa643ea8</a:MessageID> | |
<a:ReplyTo> | |
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | |
</a:ReplyTo> | |
</s:Header> | |
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
View sfmc-retrieve-triggeredsenddefinition.amp
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
%%[ | |
var @ret, @filter, @status, @rr | |
Set @ret = CreateObject("RetrieveRequest") | |
SetObjectProperty(@ret,"ObjectType","TriggeredSendDefinition") | |
AddObjectArrayItem(@ret,"Properties","Name") | |
Set @filter = CreateObject("SimpleFilterPart") | |
SetObjectProperty(@filter,"Property","CustomerKey") |
View sfmc-retrieve-triggeredsenddefinition.amp
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
%%[ | |
var @ret, @filter, @status, @rr | |
Set @ret = CreateObject("RetrieveRequest") | |
SetObjectProperty(@ret,"ObjectType","TriggeredSendDefinition") | |
AddObjectArrayItem(@ret,"Properties","Name") | |
Set @filter = CreateObject("SimpleFilterPart") | |
SetObjectProperty(@filter,"Property","CustomerKey") |
View sfmc-lookup-data-extension-rows.js
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"); | |
var birthdayDE = DataExtension.Init("birthdayDE"); | |
var filter = { | |
Property: "EmailAddress", | |
SimpleOperator: "equals", | |
Value: "abc@gmail.com" | |
}; | |
var data = birthdayDE.Rows.Retrieve(filter); | |
Write("<br>data.length: " + data.length); |
View sfmc-dynamic-dataextension-column-headings.js
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"); | |
var hidden_fields = "_CustomObjectKey,Lookup_Flag"; | |
var DE = DataExtension.Init("DataExtensionName"); | |
var data = DE.Rows.Lookup(["Lookup_Flag"], [1], 10, "LookupField"); | |
if (data.length > 0) { | |
Write("<table border='1' cellpadding='2' cellspacing='3' style='border-collapse:collapse;'>"); | |
Write("<tr>"); |
View sfmc-dataextensionobject-retrieve-soap-envelope.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> | |
<s:Header> | |
<a:Action s:mustUnderstand="1">Retrieve</a:Action> | |
<a:MessageID>urn:uuid:e3f7fdfe-d225-47fb-a764-ad4f465fb724</a:MessageID> | |
<a:ReplyTo> | |
<a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> | |
</a:ReplyTo> | |
<a:To s:mustUnderstand="1">https://webservice.exacttarget.com/Service.asmx</a:To> | |
<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1"> |
View sfmc-ampscript-regex-match.amp
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
%%[ | |
var @str1, @str1b, @str2, @str2b, @str3, @str3b, @str4, @str4b | |
set @str1 = "whee 1/2 whoop" | |
set @str1b = replace(@str1,regexmatch(@str1, "\s\w/\w\s" , 0 , "IgnoreCase"), " ") | |
set @str2 = "whee *derp* whoop" | |
set @str2b = replace(@str2,regexmatch(@str2, "\*\w+\*" , 0 , "IgnoreCase"), "") | |
set @str3 = "whee (whatev) whoop" | |
set @str3b = replace(@str3,regexmatch(@str3, "\s\(.+\)\s" , 0 , "IgnoreCase"), " ") |
View sfmc-ampscript-dynamic-subject-line-options.amp
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
%%[ /* IIF() */ | |
var @firstName, @intro | |
set @firstName = AttributeValue("firstName") /* returns blank if null */ | |
set @intro = "Hello" | |
if not empty(@firstName) then | |
set @intro = concat(@intro, ", ", @firstName) | |
endif | |
set @intro = concat(@intro,"! Check out these deals") |
OlderNewer