0

I'm wanting to be able to send the following HTML code with EmailJS.

<div>
    <p>Please click below</p>
    <br/>
    <a href="http://website.com/path/to/link">Click me!</a>
</div>

It says on the EmailJS website that you can send HTML in emails, but there's no example given as to how you do that. All of the tutorials and examples online for EmailJS don't show how to send HTML in an email. If anyone knows how, I'd greatly appreciate the help!

It says at https://www.emailjs.com/docs/faq/can-I-send-html-emails/ that you can create HTML emails, but no example is given. Absolutely none of the tutorials and examples I've come across so far show how to put HTML into an email.

2 Answers 2

3

In general, I know that it's not a safe idea to be sending HTML this way, which is why it's hard to find, but just for starters, you can use 3 brackets in your EmailJS template variable, like this, {{{ myHTML }}}. Then, just wrap your HTML tags and content in a string and send that variable on through. It will look odd, but EmailJS will interpret it correctly. I've done small things this way but I've never sent a link this way. It looks a little dangerous to me.

Sign up to request clarification or add additional context in comments.

1 Comment

It's for a school project so I think I'll be safe using the "unsafe" method just this once ;)
0

In the template editor there is a code button that looks like this: <>

Click on that and you can edit the HTML code of the email directly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.