twilio studio contact.channel.address giving strange string

275 Views Asked by At

I have a studio flow I have a run function widget in it ,and I am forwarding sms to another number by this function(given below)

Now as a pararmeter to this function I have provide sender={{contact.channel.address}}. Which actually should provide sms senders number. But in reality its (calling event.sender in function) creating a strange string like this sms_4yx0zwp2imdvyezjogf3vg1nj3dmarei.

exports.handler = function(context, event, callback) {

const twilioClient = context.getTwilioClient();
  let from =+xxxxxx //
   let to = ${event.forwardTo};
   let body = A sms from ${event.sender}: ${event.text};
   //the event.sender above line creating strange string
 twilioClient.messages
  .create({
   body: body,
    to: to,
    from: from,
       })
       .then((message) => {
          console.log('SMS successfully sent');
          console.log(message.sid);
          return callback(null, 'success');
              })
           .catch((error) => {
            console.log(error);
                return callback(error);
         });

            };
0

There are 0 best solutions below