This is my button used in html where I am having an onClick attribute for the button to open the link mentioned there , where the button link is not working.
I am sending this email through nodemailer using node.js
<div style="text-align: center; ">
<button style="border-radius: 5px;
text-align: center;
padding: 10px;
font-size: medium;
border: none;
color: aliceblue;
background-color: blue;"
onClick="window.open('http://localhost:3000/tournaments');">
Register
</button>
</div>
this is function which calls uses the HTML template concept to use the above html
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'test@gmail.com',
pass: 'test'
}
});
const email = new Email({
transport: transporter,
send: true,
preview: false,
views: {
options: {
extension: 'ejs'
}
},
});
email.send({
template:path.join(__dirname,'./templates/emailCampaign'),
message: {
from: 'test@gmail.com',
to: 'test@gmail.com,test@srmist.edu.in',
},
locals: {
tournament_name:tournament_name,
date:(new Date(date)).toLocaleDateString(),
time:(new Date(date)).toLocaleTimeString(),
fee:registration_fee,
sections:sections,
description:description
},
}).then(() => console.log('email has been sent!'));