Hi Eitan,
I was able to look at your WhatsApp Verify Twilio tutorial and implement a WhatsApp Verification for users who are registering to an online course.
I am using the same principals to send WhatsApp message as a one way communication tool to send the a message on approval. The message will contain a generic message "Dear applicant your application has been approved." But when I try to use the client.messages.create there is no response when I run the code from the back end twilio.jsw. My code is below: 👇
export const sendWhatsAppMessage = async()=>{
const twilio = require("twilio");
const accountSid = await getSecret("twilioAccountSid");
const authToken = await getSecret("twilioAuthToken");
const serviceID = "VA40b8535ce62d05f7035e5bb5ccb83a01";
const twilioPhoneNumber = await getSecret ("twilioPhoneNumber")
const client = twilio(accountSid, authToken)
const sendMessage = await client.messages.create({
body: "Dear student, your application for admission into CCD, Batch 40 has been approved . Please wait for payment link to complete the admission.",
from: twilioPhoneNumber,
to: "+8801712185328",
});
console.log(sendMessage.body)
return sendMessage;
}
I am also attaching a video which shows what happens when I run the code in backend.
The WhatsApp number I am using is being used for the verification.
Do I need to use a different number or is there something wrong with the code?