Skip to content

Instantly share code, notes, and snippets.

View katydorjee's full-sized avatar
🤩

Karma Tsering Dorjee katydorjee

🤩
View GitHub Profile
@katydorjee
katydorjee / GIFEncoder.class.php
Created January 27, 2017 05:18 — forked from SeanJA/GIFEncoder.class.php
dynamic animated gif clock
<?php
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Formerly known as:::
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu
::
:: This class is a rewritten 'GifMerge.class.php' version.
::
:: Modification:
<a href='%%=MicrositeURL(888888,"subscriberMID", "12345678")=%%'>Update Profile</a>
@katydorjee
katydorjee / sfmc-ampscript-micrositebaseurl-3.js
Created January 27, 2017 05:20 — forked from wvpv/sfmc-ampscript-micrositebaseurl-3.js
SFMC AMPScript MicrositeBaseURL() 3
<script type="text/javascript" runat="server">
Platform.Load("core", "1.1.1");
</script>%%[set @subscriberMID = RequestParameter("subscriberMID")]%%<script type="text/javascript" runat="server">
if (Variable.GetValue("@subscriberMID") != "") {
memberid = Variable.GetValue("@subscriberMID");
} else {
memberid = Attribute.GetValue("memberid");
}
</script>
@katydorjee
katydorjee / sfmc-ampscript-upsert-data-extension-row.amp
Created January 27, 2017 05:22 — forked from wvpv/sfmc-ampscript-upsert-data-extension-row.amp
SFMC AMPScript Upsert/UpdateAdd Data Extension Row
%%[
VAR @deObj, @prop, @de_statusCode, @de_statusMsg, @errorCode
var @FirstName, @LastName, @Email, @SubscriberKey
set @FirstName = RequestParameter("FirstName")
set @LastName = RequestParameter("LastName")
set @Email = RequestParameter("Email")
set @SubscriberKey = RequestParameter("SubscriberKey")
<?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">
@katydorjee
katydorjee / sfmc-ampscript-lookup-multiple-column-single-row.amp
Created February 6, 2017 18:34 — forked from wvpv/sfmc-ampscript-lookup-multiple-column-single-row.amp
SFMC AMScript Lookup multiple column values from a single row
%%[
var @rows, @row, @rowCount
var @lookupValue
set @lookupValue = "whee"
set @rows = LookupRows("DataExtensionName","LookupColumn", @lookupValue)
set @rowCount = rowcount(@rows)
if @rowCount > 0 then
@katydorjee
katydorjee / sfmc-ampscript-lookup-multiple-column-multiple-ordered-rows.amp
Created February 6, 2017 18:35 — forked from wvpv/sfmc-ampscript-lookup-multiple-column-multiple-ordered-rows.amp
SFMC AMScript Lookup multiple column values from multiple ordered rows
%%[
var @rows, @row, @rowCount, @numRowsToReturn, @lookupValue, @i
set @lookupValue = "whee"
set @numRowsToReturn = 0 /* 0 means all */
set @rows = LookupOrderedRows("DataExtensionName",@numRowsToReturn,"DEColumn1 desc, DEColumn2 asc","LookupColumn", @lookupValue)
set @rowCount = rowcount(@rows)
if @rowCount > 0 then
@katydorjee
katydorjee / dataviews.js
Created February 6, 2017 18:38 — forked from psapir/dataviews.js
Retrieving DataViews with AMPScript
%%[
var @rows
set @rows = LookupRows("_ListSubscribers","SubscriberKey",emailaddr)
]%%
@katydorjee
katydorjee / ampscript cheat sheet.txt
Created February 6, 2017 18:39 — forked from FaldoAU/ampscript cheat sheet.txt
Dave's AMPScript Cheat Sheet
// Dave's AMPScript cheat sheet.
// AMPScript is ExactTarget (SFDC Marketing Cloud)'s server side scripting language.
// It's a bit of a pig, plus the docs are numerous and the examples aren't contextual.
// This assumes you don't need hand holding, and just need to get your head around it.
// It's also my reference for the snippets I use all the time (I'm a formatting stickler).
// These examples come from microsites I've written - adapt 'em for use elsewhere.
// Multi line AMPScript %%[contained within delimiters]%% gets interpreted on the server.
@katydorjee
katydorjee / Hide contents in Microsoft clients.html
Last active March 10, 2017 03:43
Hide contents in Microsoft clients
<!--[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>