1

We need to send a personalized SMS to a group of contacts. We made a working block of code that does that, but we call the server for each SMS like this:

var sendSMSResult = HTTP.Post(sendSMSEndpoint, 'application/json', Platform.Function.Stringify(smsBody), headerNames, headerValues);

In smsBody we saved the info about the message:

var smsBody = {};
smsBody.MobileNumbers = phones;
smsBody.Subscribe = true;
smsBody.Resubscribe = true;
smsBody.Keyword = 'STOP';
smsBody.Override = true;
smsBody.MessageText = 'Mr ' + FirstName + ' your paycheck is ready';

If we try to send the SMS in bulk (to more phone numbers at once) only the last information is saved so it sends the same message to all phone numbers. It is possible to send a personalized SMS in one Call? (Like to sending a list of messages or something like that)

Example:

  • SMS we want to sent to Mr X: Mr X your paycheck is ready.
  • SMS we want to sent to Mr Y: Mr Y your paycheck is read
  • SMS that is being sent to Mr X: Mr Y your paycheck is ready.
  • SMS that is being sent to Mr Y: Mr Y your paycheck is ready.
2

you can't use "Override": true, set the "messageText" this way and expect different messages to be delivered.

Consider this sample payload for two customers:

{
    "Subscribers": [
        {
        "MobileNumber": "15555554410",
        "SubscriberKey": "ExampleSubKey1",
        "Attributes":{
            "FirstName":"Michael"
            }
        },
        {
        "MobileNumber": "15555552254",
        "SubscriberKey": "ExampleSubKey2",
        "Attributes":{
            "FirstName":"Kristen"
            }
        }
    ],
    "Subscribe": "true",
    "Resubscribe": "true",
    "keyword": "JOINSMS",
    "Override": "true",
    "messageText": "Kristen, your paycheck is ready."
}

This is kind of what your code must be generating - the same message will be delivered to both customers. Override says Marketing Cloud to fully ignore what's written in the template in Marketing Cloud and just send the messageText to everyone in the Subscribers array.

To fully send in bulk and have messages personalized, you need to remove "Override": "true". and introduce another attribute in the Subscribers array so that a single customer object looks in this array like this:

{
"MobileNumber": "15555552254",
"SubscriberKey": "ExampleSubKey2",
"Attributes":{
    "smsText":"Mr Y your paycheck is ready"
    }
}

Then you need to edit the SMS template in MC, to read the smsText attribute and send it to customers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.