verivy email before log in

This commit is contained in:
Dobromir Popov
2024-05-24 19:01:24 +03:00
parent 0f6e094f24
commit a9deca22f0
6 changed files with 128 additions and 12 deletions

View File

@ -114,6 +114,17 @@ exports.SendEmail = async function (to, subject, text, html, attachments = []) {
return result;
};
exports.SendEmail_ValidateTemplate = async function (to, token, firstName, lastName) {
let validateUrl = process.env.NEXTAUTH_URL + "/api/email?action=email_response&emailaction=validateEmail&token=" + token + "&email=" + to;
return await this.SendEmailHandlebars(to, "emailValidate", {
user: to,
validateUrl: validateUrl,
sentDate: common.getDateFormated(new Date())
});
};
exports.SendEmailHandlebars = async function (to, templateName, model, attachments = []) {
try {
// Ensure the sender and mailtrapTestClient are correctly defined or imported