Skip to content

Instantly share code, notes, and snippets.

View psapir's full-sized avatar

Pato Sapir psapir

View GitHub Profile
@psapir
psapir / csv-ssjs.js
Created May 28, 2016 11:10
Creating a CSV download page with SSJS
Name,EmailAddress
Pato,pato@bh.exacttarget.com
Bill,bill@bh.exacttarget.com
<script runat=server>
Platform.Load("core", "1");
HTTPHeader.SetValue("content-disposition","attachment; filename='test.csv'");
</script>
@psapir
psapir / dataviews.js
Created May 29, 2016 11:11
Retrieving DataViews with AMPScript
%%[
var @rows
set @rows = LookupRows("_ListSubscribers","SubscriberKey",emailaddr)
]%%
@psapir
psapir / gist:895d0b95b8c60073806c4a2d0174feff
Last active August 12, 2016 17:32
Distributing Rows Equally with Query Activities
SELECT FirstName, EmailAddress, NTILE(3) OVER(ORDER BY NewID() DESC) AS groupID
FROM Subscribers
@psapir
psapir / index.html
Last active November 12, 2016 10:30
Example of requesting landing pages locally
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Devs United, Inc.</title>
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
</head>
<body>
<script>
@psapir
psapir / fiddler.js
Created November 12, 2016 10:53
Fiddler Custom Rules example
static function OnBeforeResponse(oSession: Session) {
if (oSession.hostname.Contains("exacttarget.com"))
{
oSession.oResponse.headers.Add("Access-Control-Allow-Origin", "*");
}
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
}
<html>
<table>
<tr><td><wftcontent id=“bc1-b”></td><tr>
</table>
<!-- Start RealTime Email Embed - Patents Pending -->
<img src="https://em.realtime.email/service/rte?kind=weather&id=1187086557&esp_uid=%%Hash_ID%%&dim0=%%Hash_ID%%"/>
<!-- End RealTime Email Embed - Patents Pending -->
@psapir
psapir / landing.html
Created February 16, 2017 01:32
anz landing
<!-- before started block--><div class="content-block before-started"><div class="block-title">BEFORE YOU GET STARTED</div><div class="paragraph1 clearfix"><div class="paragraph1-logo"><img src="../../images/before_logo.png" style="max-width: 100%"/></div><div class="paragraph1-content"><span>Please consider which card is suitable
for your needs and be aware that the
interest rate and annual fee for each
type can vary. You can view the&nbsp;<a href="" class="blue">Credit Card Key Facts Sheet</a>&nbsp;for more
information about each card.</span></div></div><p>If your application is approved, a new card
account will be opened. Your existing card
account will be closed 14 days after ANZ's
receipt of this application, or on activation of
your new card(s), whichever is the sooner. You
will not receive a final statement on your
@psapir
psapir / piezas-gratis.html
Created March 28, 2017 13:17
piezas gratis modificado
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div align="center">
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td colspan="4" >
<img src="http://image.S7.exacttarget.com/lib/fe9213727262047e71/m/1/piezas+gratis_pic1.JPG" border="0" alt="" style="float:left" />
</td>
</tr>
<tr>
%%[
var @action,@entrycode,@Json,@JsonNotFound,@EmailAddress,@FristName,@LastName,@phone,@rowCount,@row,@rows
set @action=Requestparameter("action")
set @entrycode=Requestparameter("entrycode")
set @JsonNotFound=' {"status": "error","message": "Could not find record with entrycode" }'
If @action=="get" and not empty (@entrycode) then
set @rows = LookupRows("Register","EntryCode",@entrycode)
set @rowCount = rowcount(@rows)