Im using Mailgun to send emails with this function on my node server.
The link to my site is coming out as plain text rather than a clickable link. How can I make the link be an actual href in the email?
const emailWelcome = ({ name, email }) => {
const data = {
from: 'James <[email protected]>',
to: email,
subject: 'Welcome to My Site',
text: `Hi ${name},
Welcome to <a href="http://example.com/">My Site</a>
James
`,
};
mailgun.messages().send(data, function(error, body) {
console.log(body);
});
};
Looking at the documentation for
mailgun-js
it says:https://www.npmjs.com/package/mailgun-js#sending-mime-messages
The documentation then provides this code example:
At the time of sharing this, the current version is
0.20.0
.As the code demonstrates, with a multi-part message you will need to provide both a plain text and HTML version of the message.