Skip to content

Instantly share code, notes, and snippets.

View Generate-ICS-File-In-Marketing-Cloud.HTML
<script runat="server">
try{
</script>
%%[
Set @ORGANIZER_txt = 'SalesforceFan'
SET @UID_txt = "SalesforceFan_"
SET @DTSTAMP_txt = Concat(Format(Now(),"yyyyMMdd","Date"), "T", Format(Now(),"HHmmss","Date"), "Z")
SET @DTSTART_txt = Concat(Format(Now(),"yyyyMMdd","Date"), "T", Format(Now(),"HHmm","Date"), "00Z")
SET @DTEND_txt = Concat(Format(Now(),"yyyyMMdd","Date"), "T", Format(Now(),"HHmm","Date"), "00Z")
Set @LOCATION_txt = 'India'
View Track-Bitly-Links-In-Salesforce-Marketing-Cloud.js
View Retrieve-Assets-SSJS.js
<script runat = "server" >
Platform.Load("Core", "1");
try {
//authenticate to get access token
var authEndpoint = 'https://xxxxx.auth.marketingcloudapis.com/' //provide API endpoint
var payload = {
client_id: "xxxxx", //pass Client ID
client_secret: "xxxxx", //pass Client Secret
grant_type: "client_credentials" //pass MID
};
View Claim-Coupon-Email.HTML
<!-- {{={< >}=}} -->
<!DOCTYPE html>
<html amp4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
View Claim-Coupon-SSJS.js
<script language = 'javascript' runat = 'server' >
Platform.Load('Core', '1');
// Arrays of allowed values for both Sender Address and Sender Origin
// Sender Address is the from address when you send an email, make sure your expected from address is included in the list
// Sender Origin represents the domain originating the request
// The Marketing Cloud origin is in place to allow testing in Subscriber Preview, update that value to match your stack
var isAllowed = {
senderAddress: [
View Render-Text-Based-Upon-Count-Email.HTML
<!-- {{={< >}=}} -->
<!DOCTYPE html>
<html amp4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
View Display-Live-coupon-cloudpage-code.js
<script language='javascript' runat='server'>
Platform.Load('Core', '1');
// Arrays of allowed values for both Sender Address and Sender Origin
// Sender Address is the from address when you send an email, make sure your expected from address is included in the list
// Sender Origin represents the domain originating the request
// The Marketing Cloud origin is in place to allow testing in Subscriber Preview, update that value to match your stack
var isAllowed = {
senderAddress:[
'amp@gmail.dev'
View Display-Live-Coupon-Email-Code.html
<!-- {{={< >}=}} -->
<!DOCTYPE html>
<html amp4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
View Amp4Email-SSJS-Full-Code.Js
<script language = 'javascript' runat = 'server' >
Platform.Load('Core', '1');
// Arrays of allowed values for both Sender Address and Sender Origin
// Sender Address is the from address when you send an email, make sure your expected from address is included in the list
// Sender Origin represents the domain originating the request
// The Marketing Cloud origin is in place to allow testing in Subscriber Preview, update that value to match your stack
var isAllowed = {
senderAddress: [
View Amp4Email-Email-Full-Code.HTML
<!-- {{={< >}=}} -->
<!DOCTYPE html>
<html amp4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-selector" src="https://cdn.ampproject.org/v0/amp-selector-0.1.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>