Replaced the previous e-mail verification process for our own
This commit is contained in:
@@ -10,7 +10,7 @@ interface MailOptions {
|
||||
context: object;
|
||||
}
|
||||
|
||||
export function prepareMailer(): nodemailer.Transporter {
|
||||
export function prepareMailer(template?: string): nodemailer.Transporter {
|
||||
const transport = nodemailer.createTransport({
|
||||
host: process.env.SMTP_HOST,
|
||||
auth: {
|
||||
@@ -22,7 +22,7 @@ export function prepareMailer(): nodemailer.Transporter {
|
||||
const handlebarOptions: hbs.NodemailerExpressHandlebarsOptions = {
|
||||
viewEngine: {
|
||||
partialsDir: path.resolve("src/email/templates"),
|
||||
defaultLayout: "src/email/templates/main",
|
||||
defaultLayout: `src/email/templates/${template || "main"}`,
|
||||
},
|
||||
viewPath: path.resolve("src/email/templates"),
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<div style="background-color: #ffffff; color: #353338;"
|
||||
class="h-full min-h-screen w-full flex flex-col p-8 gap-16 text-base" class="text-base">
|
||||
class="h-full min-h-screen w-full flex flex-col p-8 gap-16 text-base">
|
||||
<img src="/logo_title.png" class="w-48 h-48 self-center" />
|
||||
<div>
|
||||
<span>Hello future {{type}} of <b>EnCoach</b>,</span><br />
|
||||
|
||||
22
src/email/templates/verification.handlebars
Normal file
22
src/email/templates/verification.handlebars
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<div>
|
||||
<p>Hello {{name}},</p>
|
||||
<br />
|
||||
<p>Follow this link to verify your email address.</p>
|
||||
<a href="https://platform.encoach.com/action?mode=signIn&continueUrl={{email}}&oobCode={{code}}">Verify account</a>
|
||||
<br />
|
||||
<br />
|
||||
<p>If you didn’t ask to verify this address, you can ignore this email.</p>
|
||||
<br />
|
||||
<p>Thanks,</p>
|
||||
<p>Your EnCoach team</p>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
5
src/email/templates/verification.handlebars.json
Normal file
5
src/email/templates/verification.handlebars.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Tiago Ribeiro",
|
||||
"email": "tiago.ribeiro@ecrop.dev",
|
||||
"code": "123"
|
||||
}
|
||||
Reference in New Issue
Block a user