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 customerName = "Dorjee"; | |
</script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> |
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
SELECT ID, FirstName, LastName, EmailAddress FROM CustomerMaster | |
WHERE EmailAddress NOT LIKE '%_@__%.__%' |
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
updatePublicationList(12345, "003X123456789", "Unsubscribed") | |
function updatePublicationList(listId, subscriberKey, status) { | |
/* | |
status = Unsubscribed or status = Active | |
*/ | |
var subArr = { | |
"SubscriberKey": subscriberKey, | |
"Lists": [] | |
}; |
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
function clearDataExtension(externalKey) | |
{ | |
var prox = new Script.Util.WSProxy(); | |
var action = "ClearData"; | |
var props = { CustomerKey: externalKey }; | |
var data = prox.performItem("DataExtension", props, action); | |
} |
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 @query = "i love momo" | |
SET @URL = TRIM(HTTPGet(Concat("https://api-ssl.bitly.com/v3/shorten?access_token=<Access Token>&format=txt&longUrl=https%3A%2F%2Fwww.google.com/#q=",@query))) | |
]%% | |
%%=v(@URL)=%% | |
<!-- | |
Note: You need to create Bitly account and get the 'Access Token' | |
https://bitly.com |
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"); | |
try { | |
var qd = QueryDefinition.Init("SQL_Query_External_Key"); | |
var campaignId = 'WINTER SALE' | |
var sql = "SELECT SubscriberKey, EmailAddress, FirstName, Status FROM MasterCustomer WHERE Status = '" + campaignId + "' FROM CampaignMaster"; | |
var status = qd.Update({ | |
Name : "SQL_Query_Name", |
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 @status = DeleteData("DataExtension Name", "SubscriberKey","XXXXXXXXXX") | |
]%% | |
Status: %%=v(@status)=%% |
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
SELECT Id, | |
Email, | |
FirstName, | |
LastModifiedDate, | |
CurrentDateTime | |
FROM ( | |
SELECT Id, | |
Email, | |
FirstName, | |
LastModifiedDate at time zone 'Central America Standard Time' at time zone 'Aus Eastern Standard Time' LastModifiedDate, |
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
SELECT TOP 10 [Contact ID], | |
Email, | |
[Full Name], | |
[First Name], | |
[Last Name], | |
Mobile | |
FROM [Customer] | |
ORDER BY NEWID() |
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
function getDataExtensionRowCount(DE_Name) { | |
if (DE_Name == '' || DE_Name == null) { | |
return null; | |
} else { | |
var ampscriptCodeLine = '%' + '%[SET @dataExtensionRowCount = DataExtensionRowCount("' + DE_Name + '")]%' + '%'; | |
Platform.Function.TreatAsContent(ampscriptCodeLine); | |
var dataExtensionRowCount = Platform.Variable.GetValue("@dataExtensionRowCount"); | |
return DataExtensionRowCount(dataExtensionRowCount); | |
} | |
} |