So i’m a bit new and i tried to do this tutorial but i’m confused about the trial number provided by the twilio and was wondering how can i change it, i have linked the video i was referring to
#NodeJS and #Twilio to create an automated script which will send a message every hour using a CRON job. Basically i want to send someone automatic messages but from my number to their cell so how is it possible or am i doing something wrong, i referred this video but got stuck anyway
const cron = require('node-cron');
const config = require('./config');
const accountSid = config.Account_SID ;
const authToken = config.Auth_Token ;
const client = require('twilio')(accountSid, authToken);
const messages = require('./messages');
const currentMessage = 0;
function sendMessage() {
client.messages
.create({
body: messages[currentMessage],
from: '+14849292367',
to: config.twilio_phone_number
})
.then(message => {
currentMessage++; console.log(message)
.done();
});
}
cron.schedule('2 * * * *', () => {
console.log('message sent');
sendMessage();
});
i put the twilio trial number given but there’s no output and my terminal section just gives output of cronjob