Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

send sms using twilio in node

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: #send #sms #twilio #node
ADD COMMENT
Topic
Name
1+1 =