如何使用node和sendgrid发送包含链接的电子邮件



我目前正尝试在节点应用程序中使用sendgrid发送一封电子邮件,其中包括一个电子邮件确认链接。我完全不确定如何实现这一点,而医生们也于事无补。如果有人知道如何做到这一点,请提出建议。当前代码:

const msg = {
to: userObj.username,
from: "email",
subject: "dashboard account",
text: `Hello, you have successfully created an account for the Dashboard`,
html: "<a href='localhost:1337/'>Confirm Email<a/>"
};
sgMail.send(msg).catch(err => console.log(err));

电子邮件发送正确,但只包含"确认电子邮件"字样,没有链接。

这样试试:

html: `<a href='https://github.com/zishon89us/node-cheat/blob/master/send_emails/send_grid.js#L40'>This is Link<a/>`

最新更新