Skip to content

Commit

Permalink
changed up the UI of the verification email
Browse files Browse the repository at this point in the history
  • Loading branch information
benlee04 committed Oct 23, 2024
1 parent 17f1511 commit ffe9c90
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions lifescape-server/src/routes/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,34 @@ const transporter = nodemailer.createTransport({
// Function to send email with the verification link
const sendEmail = (toEmail: string, verificationLink: string) => {
const mailOptions = {
from: 'your-email@gmail.com',
from: 'lifescape9@gmail.com',
to: toEmail,
subject: 'Verify your email for LifeScape',
text: `Please verify your email by clicking the following link: ${verificationLink}`,
html: `<p>Please verify your email by clicking <a href="${verificationLink}">here</a>.</p>`,
html: `
<div style="font-family: Arial, sans-serif; color: #333; max-width: 600px; margin: 0 auto; padding: 20px; border: 1px solid #e1e1e1; border-radius: 10px;">
<h2 style="text-align: center; color: #4CAF50;">Verify your email for LifeScape</h2>
<p style="font-size: 16px; line-height: 1.5;">Hi there,</p>
<p style="font-size: 16px; line-height: 1.5;">
Thank you for signing up for LifeScape! To complete your registration, please verify your email address by clicking the button below.
</p>
<div style="text-align: center; margin: 30px 0;">
<a href="${verificationLink}"
style="background-color: #4CAF50; color: white; padding: 10px 20px; text-decoration: none; font-size: 16px; border-radius: 5px;">
Verify Email
</a>
</div>
<p style="font-size: 14px; line-height: 1.5;">
If you didn't request this email, you can safely ignore this message.
</p>
<p style="font-size: 14px; color: #888;">Cheers, <br> The LifeScape Team</p>
<hr style="border: none; border-top: 1px solid #e1e1e1; margin: 20px 0;">
<p style="font-size: 12px; color: #999; text-align: center;">
You are receiving this email because you registered with LifeScape.
<br>
If you have any questions, contact us at <a href="mailto:[email protected]" style="color: #4CAF50; text-decoration: none;">[email protected]</a>.
</p>
</div>
`,
};

transporter.sendMail(mailOptions, (error, info) => {
Expand All @@ -35,6 +58,7 @@ const sendEmail = (toEmail: string, verificationLink: string) => {
});
};


/** @api {post} /users/register Register User
* @apiName RegisterUser
* @apiGroup User
Expand Down

0 comments on commit ffe9c90

Please sign in to comment.