Thank you for subscribing to our newsletter! Stay tuned for updates.
', + }; + + + await transporter.sendMail(mailOptions); + res.status(200).json({ message: 'Email sent successfully' }); + + } catch (error) { + console.error('Error sending email:', error); + res.status(500).json({ error: 'Error sending email' }); + } + + } else { + res.status(405).json({ message: 'Method not allowed' }); + } +}