verivy email before log in
This commit is contained in:
@ -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
|
||||
|
16
src/templates/emails/emailValidate.hbs
Normal file
16
src/templates/emails/emailValidate.hbs
Normal file
@ -0,0 +1,16 @@
|
||||
{{!--Subject: ССОМ: Потвърдете имейла си--}}
|
||||
|
||||
<section>
|
||||
<p>Здравей {{user}},</p>
|
||||
<p>Получихме заявка за вход в сайта за Специално свидетелстване на обществени места в София. </p>
|
||||
<p>За да потвърдиш твоя достъп моля използвай бутона по долу или <a href="{{validateUrl}}">кликни тук</a>.</p>
|
||||
<p style="text-align: center;">
|
||||
<a href="{{validateUrl}}"
|
||||
target="_blank"
|
||||
style="background-color: #4CAF50; color: white; padding: 10px 20px; text-decoration: none; display: inline-block; border-radius: 5px;">
|
||||
Потвърждавам</a>
|
||||
</p>
|
||||
</section>
|
||||
<footer style="margin-top: 20px; text-align: center;">
|
||||
<p>Изпратено до {{user}} {{sentDate}}</p>
|
||||
</footer>
|
Reference in New Issue
Block a user