View SSJS Automation Error Details
This file contains 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"); | |
/* ======================================================= */ | |
/* ======================== Config ======================= */ | |
var authurl = "authmarketingcloudapiscom/"; //Get this from Setup | |
var client_id = "xxxxxxxxxxxxxxxxx"; //Get this from Setup | |
var client_secret = "yyyyyyyyyyyyyyy"; //Get this from Setup | |
var slackwebhook = "zzzzzzzzzzzzzzzzzzzzz"; //Get this from Slack API | |
var gtm = 10; //This is your GMT modifier for your timezone | |
var notify = "@channel"; //use this to notify the channel or specific people |
View Simple Message to Slack Channel using Webhook (SSJS)
This file contains 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"); | |
try{ | |
var url = 'https://hooks.slack.com/services/xxxxxxxx/yyyyyyyyyyyy/zzzzzzzzzzzzzzzz'; | |
var contentType = 'text/plain'; | |
var payload = '{"text":"Now this is SSJS!"}'; | |
var headerNames = []; | |
var headerValues = []; | |
var result = HTTP.Post(url, contentType, payload, headerNames, headerValues); |
View DE_Count_Slack_API.sj
This file contains 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
/* | |
======================================================= | |
Title: SFMC DE Record Count Slack API | |
Author: Cameron Robert | |
------------------------------------------------------- | |
Instructions: | |
1: Create a Javascript Code Resource CloudPage | |
2: Paste the below code to the page | |
3: Use the Cloud Page URL as "Request URL" for a "Slash Commands" component in the Slack API Dashboard. | |
4: Save and Authorise your Slack app to a workspace/channel. |
View Create_DE-Query_PushAddressDataView.ssjs
This file contains 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" language="javascript"> | |
Platform.Load("core","1"); | |
var name = "PushAddressDataView"; | |
/* | |
Load this is a Cloud Page to create a data extension based on the _PushAddress Data View and a Query Activity to populate it. | |
JOIN to _Subscribers as follows: | |
_PushAddress.ContactID = _Subscribers.SubscriberID | |
*/ | |
var deObj = { |
View download table to excel csv.js
This file contains 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
function exportTableToCSV($table, filename) { | |
var $rows = $table.find('tr:has(td,th)'), | |
// Temporary delimiter characters unlikely to be typed by keyboard | |
// This is to avoid accidentally splitting the actual contents | |
tmpColDelim = String.fromCharCode(11), // vertical tab character | |
tmpRowDelim = String.fromCharCode(0), // null character | |
// actual delimiter characters for CSV format |
View gist:3b9b6a611715ec3a8a60
This file contains 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
<?php | |
/** | |
* Quick hack to preview WooCommerce e-mails. | |
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136 | |
* | |
* Add this to <yourtheme>/functions.php and then visit a url like: | |
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail | |
* | |
* @return null | |
*/ |