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
//Execute User Initiated Send | |
var def = { | |
'CustomerKey': 'DCL_Test', | |
}; | |
SoapClient.perform('EmailSendDefinition', def, function(err, response){ | |
if(err){ | |
console.log(err); | |
} | |
else{ |
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
//Create User Initiated Send | |
var folderID = '100506' //Hover over or inspect the folder in the UI and grab the CID querystring parameter | |
var dexObjectID = 'cc7ce594-070f-e711-a5d3-8cdcd4aff7c9'; //DEX Object ID: https://gist.github.com/angrycider/47a2727e274ef87632c115b333aeb473 | |
var guid = uuid.v1() // https://github.com/kelektiv/node-uuid | |
var co = { | |
"Name": "TuneIn_201757f52c3c0dbf0", //Should be dynamic...same as used to create email | |
"CustomerKey": guid, | |
"Email": { | |
"ID":"105947", //Email ID https://gist.github.com/angrycider/ee39a7a87454201ea469108104b6f0e0 | |
"IDSpecified":true |
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
//Retrieve Data Extension ObjectId | |
var options = { | |
filter: { | |
leftOperand: 'CustomerKey', | |
operator: 'equals', | |
rightOperand: 'IonThreeTesting' | |
} | |
}; | |
SoapClient.retrieve( | |
'DataExtension', |
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
//Create Email | |
var emailFolderID = '99633'; //Hover over or inspect the folder in the UI and grab the CID querystring parameter | |
var co = { | |
"Name": "TuneIn_201757f52c3c0dbf0", | |
"Subject": "Game is starting now!", | |
"HTMLBody": "HTML Goes Here", | |
"CharacterSet":"UTF-8", | |
"CategoryID":emailFolderID //Folder ID from Create Folder Above...Omit to create at root | |
}; |
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
// //Create Folder | |
var parentFolderID = '100504'; //Hover over or Inspect folder in the UI and look at CID querystring parameter | |
var co = { | |
"Name": "201703", | |
"Description": "201703", | |
"ParentFolder": {"ID":parentFolderID,"IDSpecified":true}, //Omit this to create at root | |
"ContentType":"email" | |
}; | |
/* |
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
//Complex filter | |
var parentFolderID = '99624'; //Hover over or inspect the folder and look at the CID querystring parameter | |
var options = { | |
filter: { | |
leftOperand: { | |
leftOperand: 'ParentFolder.ID', | |
operator: 'equals', //https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/creating_a_filterdefinition_object.htm | |
rightOperand: parentFolderID | |
}, | |
operator: 'AND', //https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/using_complex_filter_parts.htm |
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
//Retrieve Folder within folder | |
var parentFolderID = '99624'; //Hover over or inspect the folder in the UI and look at the CID querystring variable | |
var options = { | |
filter: { | |
leftOperand: 'ParentFolder.ID', | |
operator: 'equals', | |
rightOperand: parentFolderID | |
} | |
}; | |
SoapClient.retrieve( |
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
//Describe Subscriber | |
SoapClient.describe( | |
'Subscriber', | |
function( err, response ) { | |
if ( err ) { | |
// error here | |
console.log( err ); | |
return; | |
} |
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
//UPSERT SUBSCRIBER | |
var co = { | |
"SubscriberKey": "test@fakeemail.com", | |
"EmailAddress": "test@fakeemail.com", | |
"Attributes":[{"Name":"Favorite Color","Value":"purple3"}] | |
}; | |
var uo = { | |
SaveOptions: [{"SaveOption":{PropertyName:"*",SaveAction:"UpdateAdd"}}] | |
}; |
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
//UPSERT DE | |
var co = { | |
"CustomerKey": "7254CCBC-E5F8-49B6-991E-855825DAEADD", | |
"Keys":[ | |
{"Key":{"Name":"subscriberkey","Value":"test@fakeemail.com"}}], | |
"Properties":[ | |
{"Property":{"Name":"color","Value":"purple"}} | |
] | |
}; |