twilio-sms-service
Version:
twilio sms services
29 lines (26 loc) • 525 B
JavaScript
const object = {
sendSMS: function sendSMSTwilio(
accountSid,
authToken,
messagingServiceSid,
to,
body
) {
// ** Twilio Credentials **
const client = require("twilio")(accountSid, authToken);
// ** Send SMS **
client.messages
.create({
body: body,
to: to,
messagingServiceSid: messagingServiceSid,
})
.then((message) => {
return true;
})
.catch((err) => {
return false;
});
},
};
module.exports = object;