Im sending a simple email via node mailer.
But i can't seem to make the href work, when I click the button in the email it doesn't go anywhere.
const link = `http://localhost:3000/reset-password/${user._id}/${token}`;
const output = `
<h1>You have requasted an password rest. Follow the above link to reset password</h1>
<button><a href="${link}">Click here</a></button>
<h3>This is a test</h3>
`;
let transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: process.env.EMAIL
pass: process.env.PASSWORD
},
});
// Step 2
let mailOptions = {
from: "SOME_EMAIL",
to: user.email, // TODO: email receiver
subject: "Password Reset",
html: output,
};
When I inspect that html in the email, it seems that the HREF doesnt render