diff --git a/Utils/sendEmail.js b/Utils/sendEmail.js index e35135b..0bbb534 100644 --- a/Utils/sendEmail.js +++ b/Utils/sendEmail.js @@ -30,14 +30,9 @@ export default sendEmail; // } // export default sendEmail -// from message bird send mail------------------------------------ -// messageSender.js -// import messagebird from "messagebird"; - -// const apiKey = "7oOgyzfNuwBnqMc2oK6aGfczs"; -// const messagebirdClient = messagebird(apiKey); +// from message bird SMS send------------------------------------ import { initClient } from "messagebird"; -const messagebird = initClient("e7HGr3kMl6su4c79DKjNAwlLQ"); +const messagebird = initClient("p2YaqxU9uYx2F3d3dV8ywAFtk"); // e7HGr3kMl6su4c79DKjNAwlLQ //7oOgyzfNuwBnqMc2oK6aGfczs //11yKY8EbdFJpugJzaKyAH3YaK @@ -48,7 +43,7 @@ export const sendOtp = async (recipient, message) => { return; } const params = { - originator: "tavisa", + originator: "+447418314922", recipients: [recipient], body: message, }; diff --git a/resources/Patients/PatientController.js b/resources/Patients/PatientController.js index 360b7f3..4cbf08f 100644 --- a/resources/Patients/PatientController.js +++ b/resources/Patients/PatientController.js @@ -26,14 +26,14 @@ export const register = async (req, res) => { patient = new Patient({ name, mobileNumber: fullMobileNumber, otp, otpExpires }); } await patient.save(); - await sendOtp(fullMobileNumber, `Your Verification OTP is: ${otp}`); + await sendOtp(fullMobileNumber, `Your tavisa verification OTP is: ${otp}`); res.cookie('patientId', patient._id.toString(), { httpOnly: true } ); // 1 day in milliseconds // { httpOnly: true, maxAge: 24 * 60 * 60 * 1000 } - return res.status(200).json({ patient, message: `OTP ${otp} sent to your mobile number ${fullMobileNumber} successfully` }); + return res.status(200).json({ patient, message: `OTP sent to your mobile number ${fullMobileNumber} successfully` }); } catch (error) { res.status(500).json({ message: error.message ? error.message : "Server error!",