Automatic Plain Text Emails

Resend now automatically generates plain text for your emails.

We've long enabled our customers to send both HTML and plain text versions of their emails. Sending plain text emails is a great way to ensure your emails are delivered to all email clients, including those that don't support HTML and can also help improve your email's deliverability.

In the past, you had to manually send a plain text version of your email.

const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<p>it works!</p>',
text: 'it works!', // manually sent plain text version
});

How it works

Today, we're happy to announce that Resend now automatically generates plain text for your emails.

Of course, you can always manually set the plain text version of your email, but if not provided, Resend will use the HTML to generate a plain text version.

const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<!DOCTYPE html...', // Truncated for brevity
});

If you're using the Node SDK, Resend will automatically generate a plain text version of your email from either the html or react parameter, whichever is provided.

This advanced HTML email template renders in email clients like this:

Rendered HTML template
Rendered HTML template

And Resend now automatically renders it into a plain text version as well:

JOIN ENIGMA ON VERCEL
Hello alanturing,
Alan (alan.turing@example.com)
has invited you to the Enigma team on Vercel.
Join the team https://vercel.com
or copy and paste this URL into your browser: https://vercel.com
-------------------------------------------------------------------------
This invitation was intended for alanturing. If you were not expecting
this invitation, you can ignore this email. If you are concerned about
your account's safety, please reply to this email to get in touch with us.

How to opt out

You can opt out of this behavior by setting the text value to an empty string or your own custom plain text version.

await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<p>it works!</p>',
text: '', // will not generate a plain text version
});

Conclusion

Broadcasts will continue to automatically generate plain text versions of your emails and we're excited to extend this feature to our transactional and batch sending as well.

For more information, check out the API Reference.