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 !mso]><!--> | |
<div class="show" style="font-size: 0; max-height: 0; overflow: hidden; display: none;"> | |
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="container"> | |
<tbody> | |
<tr> | |
<td align="center" valign="top" bgcolor="#ffffff" style="display:none;" class="mobile-show"> | |
<img src="http://placehold.it/600x80" width="600" height="80" style="display: block;" border="0" class="photo"> | |
</td> | |
</tr> | |
</tbody> |
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 Lookup_value = 'apple'; | |
var dataRows = Platform.Function.LookupRows('Data Extension name','Lookup field',Lookup_value); | |
if(dataRows && dataRows.length > 0) { | |
for(var i=0; i<dataRows.length; i++) { | |
Platform.Response.Write(dataRows[i]["Result_field_name"]); | |
} | |
} |
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 DE = DataExtension.Init('<Data Extension name>'); | |
var AddRows = { | |
Field1: 'Value1', | |
Field2: 'Value2', | |
Field3: 'Value3' | |
}; | |
var status = DE.Rows.Add(AddRows); |
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 targetDE = DataExtension.Init('DataExtension EXTERNAL KEY').Rows.Retrieve(); | |
for (var i = 0; i < targetDE.length; i++) | |
{ | |
Write(targetDE[i].Field1+'<br>'); | |
Write(targetDE[i].Field2+'<br>'); | |
Write(targetDE[i].Field3+'<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
%%[ | |
SET @pl = "a|b|c|d|e" | |
SET @prefArray = BuildRowSetFromString(@pl,"|") | |
SET @rCount = RowCount(@prefArray) | |
FOR @i = 1 TO @rCount DO | |
SET @ddd = Field(Row(@prefArray, @i),1) | |
]%% | |
%%=V(@ddd)=%% <br> | |
%%[ | |
NEXT @i |
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 username = 'Username'; | |
var password = 'PaSsWoRd'; | |
var serviceURL = 'https://webservice.s7.exacttarget.com/Service.asmx'; | |
//DE contains all the subscribers to be deleted. Delete all subscribers where field value of IsDeletedFromAllsubscribers is False | |
var srcDE = DataExtension.Init("Data Extension External key"); | |
var ds = srcDE.Rows.Retrieve({Property:"IsDeletedFromAllsubscribers",SimpleOperator:"equals",Value:"False"}); |
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 @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 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 @returnValue = Lookup("Data Extension name", "Field name fetch from the DE", "Field for matching condition", "Value for matching condition") | |
]%% | |
%%=v(@returnValue)=%% | |
<!-- | |
This function will return only the first occurrence of the record in a DE | |
--> |
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 @query = "Query text" | |
SET @resultSet = LookupRows("Data Extension name","Field name for matching condition", @query) | |
IF RowCount(@resultSet) > 0 THEN | |
SET @row = row(@resultSet,1) | |
SET @Field1 = Field(@row,"FieldName1") | |
SET @Field2 = Field(@row,"FieldName2") | |
SET @Field3 = Field(@row,"FieldName3") | |
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
-- Get all Active | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb | |
LEFT JOIN _EnterpriseAttribute ea ON sb.SubscriberID=ea._SubscriberID | |
WHERE sb.Status = 'Active' | |
-- Get all Unsubscribe | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb |