Sending SMS Through Analysis

Sending SMS Through Analysis

@Jeff

Hello,

I’m working on a simple script to send an SMS message to a user, and I can’t quite figure out what I’m doing wrong. I can get emails to work, but not SMS. This function gets called from within an Analysis. I’ve replaced my phone number with 5’s in the snip below, but kept the country code for USA.

async function sendSMSNotification(context) {
  const smsService = new Services(context.token).sms;
  const messageText = "test";
  const phone = "+15555555555"
  await smsService.send({to: phone, message: messageText}).then(context.log).catch(context.log);
}

I was able to successfully send a text message from an action, but not from within my analysis. When the analysis runs, the console prints "Error on SMS Server. " Appreciate any insight!