Skip to content

Instantly share code, notes, and snippets.

View jdeblank's full-sized avatar

Josh de Blank jdeblank

  • Melbourne, Australia
View GitHub Profile
@jdeblank
jdeblank / _media-queries.scss
Created May 29, 2012 04:10 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
<script runat="server">
Platform.Load("core","1.1.1");
try {
var de = DataExtension.Init('DE Name goes here');
var data = {
id: Request.GetFormField("id"),
FirstName: Request.GetFormField("firstname"),
Email: Request.GetFormField("email")
}
<script runat="server">
var skey = "abc123";
var prox = new Script.Util.WSProxy();
// query all BUs
var queryAllAccounts = true;
// set the attributes to be retrieved
// note Client.ID and not ClientID
var cols = ["Status","Client.ID"];
<script runat="server">
Platform.Load("core","1.1.1");
var listid = 1234;
var jobid = 567;
var batchid = 1;
var mids = {
BU1: 123456,
BU2: 123457,
<script runat="server">
Platform.Load("core","1.1.1");
var prox = new Script.Util.WSProxy();
// Need to retrieve the ObjectID for the Automation, which isn't available via the SFMC interface.
var cols = ["Name", "ProgramID", "IsActive"];
var filter = {
Property: "Name",
SimpleOperator: "equals",
<script runat="server">
var prox = new Script.Util.WSProxy();
var tsdKey = '123';
var EmailAddress = '[email protected]';
var tsd = {
TriggeredSendDefinition: {
CustomerKey: tsdKey
<script runat="server">
Platform.Load("core","1.1.1");
/*
Example that handles JSON data POSTed to this page.
e.g '{"firstname":"Joe","lastname":"Bloggs"}'
*/
var jsonpost, jsondata;
<script runat="server">
Platform.Load("core","1.1.1");
// Example of HTTP GET/POST to SFMC REST API to retrieve HTML of an email
try {
var authBaseUrl = 'https://abcd.auth.marketingcloudapis.com';
var authEndPoint = '/v1/requestToken';
var restBaseUrl = 'https://abcd.rest.marketingcloudapis.com';
@jdeblank
jdeblank / ssjs_wsproxy_updatePublist.js
Last active January 22, 2023 01:03
Use SSJS and WSProxy to add/update a subscriber status in Publication List within Salesforce Marketing Cloud
<script runat="server">
Platform.Load("core","1.1.1");
var subkey = "abc123";
var email = "[email protected]"
var prox = new Script.Util.WSProxy();
// Set specific BU context if required
// prox.setClientId({ "ID": 7279411 });
@jdeblank
jdeblank / ssjs_SFDC_id_check.js
Last active May 6, 2019 01:36
Verify a SFDC ID or convert from 15 to 18 char SFDC ID using SSJS from within Salesforce Marketing Cloud
<script runat="server">
Platform.Load("core","1.1.5");
var id1 = "[email protected]";
var id2 = "foobar";
var id3 = "0036F00001zNm0BQAS";
var lookup5bin = {
'00000':'A', '01000':'I', '10000':'Q', '11000':'Y',