+
Welcome to Landrush! ๐
+
Your verification code is:
+
${otp}
+
This code expires in 15 minutes.
+
If you didn't request this, please ignore this email.
+
+ `,
+ };
+
+ try {
+ await transporter.sendMail(mailOptions);
+ console.log(`OTP email sent to ${email}`);
+ return true;
+ } catch (error) {
+ console.error('Error sending OTP email:', error);
+ throw error;
+ }
+}
+
+export async function sendPasswordResetEmail(email, resetToken) {
+ const resetLink = `${FRONTEND_URL}/reset-password?token=${resetToken}`;
+
+ const mailOptions = {
+ from: process.env.EMAIL_FROM || process.env.EMAIL_USER,
+ to: email,
+ subject: 'Reset Your Password - Landrush',
+ html: `
+
+
Reset Your Password
+
Click the link below to reset your password:
+
+ Reset Password
+
+
+ Or copy this link:
+
+ ${resetLink}
+
+
+
This link expires in 1 hour.
+
If you didn't request this, please ignore this email.
+
+ `,
+ };
+
+ try {
+ await transporter.sendMail(mailOptions);
+ console.log(`Password reset email sent to ${email}`);
+ return true;
+ } catch (error) {
+ console.error('Error sending password reset email:', error);
+ throw error;
+ }
+}
+
+export async function sendWelcomeEmail(email, firstName) {
+ const mailOptions = {
+ from: process.env.EMAIL_FROM || process.env.EMAIL_USER,
+ to: email,
+ subject: 'Welcome to Landrush - Your Land Marketplace',
+ html: `
+