Last active
March 31, 2020 22:22
-
-
Save iMichaelOwolabi/f53a941ab6c423ea84e6609331a040ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const accountSid = process.env.TWILIO_ACCOUNT_SID; | |
const authToken = process.env.TWILIO_AUTH_TOKEN; | |
const sendSms = (phone, message) => { | |
const client = require('twilio')(accountSid, authToken); | |
client.messages | |
.create({ | |
body: message, | |
from: process.env.TWILIO_PHONE_NUMBER, | |
to: phone | |
}) | |
.then(message => console.log(message.sid)); | |
} | |
module.exports = sendSms; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment