SSJS: Day 24 focused on Resource

SSJS: Day 24 focused on Resource

Write an SSJS block to Re-Opt-Infrom a specific Keyword from the Mobile Connect Subscription

<script runat="server">    
  Platform.Load("core", "1.1");
  // Resubscription of Mobile Subscription
  try {
    var payload = [
        {
            "_OptOutStatusID": 0,
            "_OptInStatusID": 2,
            "_OptInMethodID": "2"
        },
        ["_MobileNumber", "_SubscriptionDefinitionID"],
        [44xxxxxxxxx0, "45xxxxx1-xxxx-xxxx-xxxx-xxxxxxxxxFE"]
    ]
     /* Subscription change returns 2 for change, 1 for no change, 0 for no object to update */
     var mobileSubscriptionDataView = DataExtension.Init("_MobileSubscription");
     response = mobileSubscriptionDataView.Rows.Update(payload[0], payload[1], payload[2]);
     Write(response);
  }
  catch(e){
    Write(e.message);
  }
</script>             


To view or add a comment, sign in

Explore topics