I’m using the Resend API to send HTML emails, but the links in the email body aren’t clickable. The HTML renders correctly (e.g., bold text works), but the link isn’t clickable. This is all running inside of a Supabase edge function, here’s the relevant part of the code:
const res = await fetch("https://api.resend.com/emails", {
method: "POST",
headers: {
...corsHeaders,
"Content-Type": "application/json",
Authorization: `Bearer ${key}`,
},
body: JSON.stringify({
from: "Company <[email protected]>",
to: email,
subject: "Verify Your Email",
html: `
<html>
<body>
<strong>Welcome!</strong><br>
Please verify your email by clicking the link below:<br>
<a href="${verificationLink}">Verify Email</a>
</body>
</html>
`,
}),
});
Everything is displayed properly but the ‘Verify Email’ just acts as plain text. Anyone have any idea why?
I tried to add a text parameter to the email as well, to see if maybe it would default to displaying text. It didn’t, it still displayed the HTML part of the email without anything being clickable. Is this a Resend API specific thing, should I use another email sending provider?
Dylan Latimer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.