Skip to content

Instantly share code, notes, and snippets.

View katydorjee's full-sized avatar
🤩

Karma Tsering Dorjee katydorjee

🤩
View GitHub Profile
<script runat="server">
Platform.Load("Core","1.1.1");
var subkey = Attribute.GetValue("_subscriberkey");
var jid = Attribute.GetValue("jobid");
var lid = Attribute.GetValue("listid");
var bid = Attribute.GetValue("_JobSubscriberBatchID");
var prox = new Script.Util.WSProxy();
var props = [
@wvpv
wvpv / sfmc-update-salesforce-objects-with-ssjs.html
Last active May 4, 2023 10:01
Update Salesforce Objects with Server-Side JavaScript
<script type="text/javascript" runat="server">
Platform.Load("core", "1");
var debug = 1;
// detect form submission
if (Request.Method == "POST") {
// retrieve the input values from the form payload
var subscriberKey = Request.GetFormField("subscriberKey");
@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 = "foo@bar.com"
var prox = new Script.Util.WSProxy();
// Set specific BU context if required
// prox.setClientId({ "ID": 7279411 });
%%[
var @debug
var @jid
var @listid
var @batchid
var @email
var @skey
var @reason
var @unsubscribeAll

AD-XX: <TOPIC - short, concise summary>

  • Date: <DATE - when the decision was made>
  • Driver: <DRIVER - list a single person driving consenus and decision making>
  • Stakeholders: <STAKEHOLDERS - list all relevant stakeholders affected by this decision>
  • Status: [PROPOSED | DECIDED | SUPERSEDED]
  • Categories: <CATEGORIES - use a simple grouping to help organize the set of decisions (e.g. backend, payment, user management, ...)>
  • Outcome: <OUTCOME - once decided, provide a short summary of the decision outcome here>

Context

@wvpv
wvpv / SFMC-SSJS-delete-rows-from-DE.js
Created March 21, 2016 14:44
SFMC SSJS Delete Rows from a Data Extension
<script runat="server">
Platform.Load("core", "1.1.1");
function pruneRows () {
var DERowKeys = DataExtension.Init("DEofRowKeys");
var DERowKeyRows = DERowKeys.Rows.Lookup(["ProcessedFlag"], [0], 50, "RowDate");
var returnString = "";