const accountSid = 'account_sid';
const authToken = 'auth_token';
const client = require('twilio')(accountSid, authToken);
client.messages
.create({
to: '+94716220786',
from: '+13022519234',
body: 'Your verification code is ' + Math.floor(1000 + Math.random() *
9000)
})
.then(message => console.log(message.sid));
console.log('receive');
console.log(Math.floor(1000 + Math.random() * 9000));
I'm trying to send sms using twilio. I have installed twilio latest version in my angular project.
But when the project runs, it says that "Cannot read property 'isTTY' of undefined"
isTTY
method? Also, are you aware that the verification code in the message-body is not the same than in theconsole.log()
- ochs.tobi