Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Twilio sms sending in express

const smsSid = process.env.SMS_SID
const smsAuthToken = process.env.SMS_AUTH_TOKEN
const twilio = require('twilio')(smsSid, smsAuthToken, {
    lazyLoading: true,
});

async sendBySms(phone, otp) {
        return await twilio.messages.create({
            to: phone,
            from: process.env.SMS_FROM_NUMBER,
            body: `Your codershouse OTP is ${otp}`,
        });
    }
 
PREVIOUS NEXT
Tagged: #Twilio #sms #sending #express
ADD COMMENT
Topic
Name
8+5 =