diff --git a/mailer.js b/mailer.js index 1253ea9..3aa4da5 100644 --- a/mailer.js +++ b/mailer.js @@ -14,8 +14,37 @@ const transporter = nodemailer.createTransport({ SES: { sesClient, SendEmailCommand }, }); +// Helper function to get color based on time of day +function getColorForTime() { + const hour = new Date().getHours(); + + if (hour >= 5 && hour < 10) { + // Morning - orange + return { + primary: '#FF9800', + gradient: 'linear-gradient(135deg, #FF9800 0%, #F57C00 100%)', + shadow: 'rgba(255, 152, 0, 0.3)' + }; + } else if (hour >= 10 && hour < 18) { + // Afternoon - blue + return { + primary: '#2196F3', + gradient: 'linear-gradient(135deg, #2196F3 0%, #005CA8 100%)', + shadow: 'rgba(33, 150, 243, 0.3)' + }; + } else { + // Evening/Night - purple + return { + primary: '#471189', + gradient: 'linear-gradient(135deg, #BA82FF 0%, #280059 100%)', + shadow: 'rgba(71, 17, 137, 0.3)' + }; + } +} + // Helper function to send email async function sendVerificationEmail(toEmail, token, name) { + const colors = getColorForTime(); const verificationLink = `https://wahwa.com/verify-email?token=${token}`; try { @@ -39,7 +68,7 @@ async function sendVerificationEmail(toEmail, token, name) {
Smart Home Automation
Thank you for joining BlindMaster! To electrify your blinds, please verify your email address 🥹 @@ -61,7 +90,7 @@ async function sendVerificationEmail(toEmail, token, name) {
Smart Home Automation
+
${code}