This file contains hidden or 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> | |
| var city = Platform.Request.GetFormField('city'); | |
| var email = Platform.Request.GetFormField('email'); | |
| // Detect form submission | |
| if ( (city) && (email) ) { | |
| var weather = getWeather(city); | 
  
    
      This file contains hidden or 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"> | |
| /*Code provided as is without warranty - make sure you understand what this code does before using it - use at your own risk*/ | |
| Platform.Load("Core","1"); | |
| try{ | |
| var prox = new Script.Util.WSProxy(); | |
| var cols = ["Name","CustomerKey","FieldType","IsPrimaryKey", "MaxLength"]; | |
| var filter = { | |
| Property: "Name", | |
| SimpleOperator: "like", | |
| Value: "email" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | %%[ | |
| SET @text = "Cameron Robert" | |
| SET @key = "8ce32e59" /* https://www.browserling.com/tools/random-hex */ | |
| OutputLine(Concat("Encrypted: ", EncryptSymmetric(@text, "des;mode=ecb;padding=pkcs7", @null, @key),"<br><br>")) | |
| SET @enctext = "iJwqnvvKdIIn7AKQOg1LHA==" | |
| OutputLine(Concat("Decrypted: ", DecryptSymmetric(@enctext, "des;mode=ecb;padding=pkcs7", @null, @key),"<br><br>")) | |
| ]%% | 
  
    
      This file contains hidden or 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
    
  
  
    
  | %%[ | |
| /*SET Your 3 Keys*/ | |
| SET @sym = 'SymmetricKey ExternalKey' | |
| SET @IV = 'IV ExternalKey' | |
| SET @Salt = 'Salt ExternalKey' | |
| /*Input Auth URI Details*/ | |
| SET @authurl = 'Authentication Base URI' | |
| /*TEMP API Key Details - To Delete after generating encrypted values*/ | 
  
    
      This file contains hidden or 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 | 
  
    
      This file contains hidden or 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); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | %%[ | |
| SET @payload = '{"text":"Hello from SFMC!"}' | |
| SET @post = HTTPPOST2('https://hooks.slack.com/services/xxxxxxxxx/yyyyyyyyyyyy/zzzzzzzzzzzzzzz','text/plain',@payload,true,@output,@header) | |
| ]%% | |
| @post= %%=v(@post)=%% <br> | |
| @output= %%=v(@output)=%% <br> | |
| @header= %%=v(@header)=%% <br> | 
  
    
      This file contains hidden or 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"> | |
| /*Code provided as is without warranty - make sure you understand what this code does before using it - use at your own risk*/ | |
| Platform.Load("Core","1"); | |
| try { | |
| var prox = new Script.Util.WSProxy(); | |
| //================== https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/accountuser.html | |
| var cols = ["Name","CustomerKey","NotificationEmailAddress", "UserID", "ActiveFlag", "Email", "IsAPIUser", "AccountUserID", "LastSuccessfulLogin", "CreatedDate", "Roles"]; | |
| //================= https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_basic_retrieve.html | |
| var filter = { | |
| LeftOperand: {Property: "Email",SimpleOperator: "like",Value: "@"}, | 
  
    
      This file contains hidden or 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"> | |
| /* | |
| Ref: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_httpPost.html | |
| Ref: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/validateEmail.html | |
| */ | |
| Platform.Load("Core","1"); | |
| try { | |
| /*=== (unsafe) Plain Text API Credentials ===*/ | |
| var authurl = "https://mcxxxxxxxxxxxxxxxx.auth.marketingcloudapis.com/"; | 
  
    
      This file contains hidden or 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 prox = new Script.Util.WSProxy(); | |
| var cols = ["Name","CustomerKey","CategoryID"]; | |
| var filter = {Property: "Name",SimpleOperator: "equals",Value: "Cam DE"}; | |
| var res = prox.retrieve("DataExtension",cols,filter); | |
| //Write('Message: '+ Stringify(res)); | |
| for (s = 0; s < res.Results.length; s++) { | 
NewerOlder