0

I am using this code for testing to send SMS everything work but i want to know if i have to buy a twilio phone to put it inside from: "" Because I want to send real SMS to my client

export const sendReservationConfirmationSMSTwilio = async ({
      firstName,
      reservationId,
      phone,
      date,
      hour,
      totalPersons,
    }) => {
      client.messages.create({
        body: `Bonjour, nouvelle réservation ${reservationId}! ${firstName} est joignable au ${phone}. Date: ${date} à ${hour}. Couverts: ${totalPersons} Commande: voir tableau de réservation`,
        from: '+15005550006',
        to: `+33${phone.slice(1)}`,
      }).then((res) => console.log(res)
    };

Thanks !

1 Answers1

0

Twilio developer evangelist here.

If you want to send SMS messages to your clients, you will need to either buy a number from Twilio, port in your existing phone number, or use an alphanumeric sender ID.

Otherwise, you seem like you are well on your way to successfully sending SMS messages.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • I'm currently using alphnumeric senderID to send sms ex: from: 'TestTest'. I didn't receive any response. It work when I use this number +15005550006 test from: '+15005550006' – Christian L Jun 04 '21 at 14:48
  • It looks, from your other answer, like you are getting an error message but not catching the error. If you chain `.catch(console.error)` after the `.then()` you will discover the issue. Also, the number you mention looks to be a test number, make sure you are using your production Account SID and Auth Token when you try to send with an alphanumeric sender ID. – philnash Jun 04 '21 at 23:55