Home / Articles / Blog

Craft and Send 50, 000 Emails at $20/month
ResendEmailEmail APIEmail SDKBackend

Craft and Send 50, 000 Emails at $20/month

This tool helps you to create emails, manage audience, and handle domains and bounces at $25/month and send to 50,000 users

BackendShrey Vijayvargiya

Section 1

Under the Hood

We have 35 email service providers APIs and SDK to send bulk emails, manage audiences and do a lot more.

www.ihatereading.in/t/5lDAaNTTc7nNQxYVomIv/Top-35-Email-APIs/Services-for-Developers

But most of the websites still have pain points in onboarding, not-easy-to-use SDK, quite costly, and very confusing to implement

I’ve tried using Mailchimp, Sendgrid, Twilio, and AWS and so far I’ve found Twilio and AWS are similar and easy-to-use APIs and SDK as well.

Lot to Cover

But still a lot to cover in terms of email service providers, for the past couple of years for our platform iHateReading, I have been using the Courier app to craft email templates and send them to my subscriber audience.

courier app doesn’t allow a method in the SDK to send HTML files directly to the audience, whereas Sendgrid allows to send HTML but they only allow to send bulk email after adding user subscribers to their database.

Bottlenecks after bottlenecks of course we have to find a product that fits to our needs and price as well.

Section 2

Resend at Rescue

I don’t want to go into pros and cons, A vs B.

Sendgrid, Twilio, Mailchimp, AWS SES and Gmail API are the top most used notification tools in the world.

But as I’ve explained the problem we have faced with them for our product and resend helps us to somehow solve it.

Here’s how

  • Resend allow you to craft emails programmatically
  • Resend provide SDK to send bulk emails directly as HTML without
  • Resend allows to add/manage subscribers as audiences
  • Resend provides a react-email npm module to create emails using React components such as Button, Inputs, Cards

check the example below

https://demo.react.email/?source=post_page-----6e6c9f5f331a--------------------------------

Using react components developers can easily create an email template and convert it into HTML format to send as an HTML.

Section 3

Components

Create Email using React components

The react-email provides built-in components to support various component types.

Using these components you can craft email in any format and get the exported into an HTML format that can be sent to the customers over the email.

Section 4

Integration and Customisation

React email helps to integrate with other tools as well making it easy for us to migrate as well.

If you are already working with any of the services mentioned below, react-email is compatible with all of them so you don’t need to take care much of migration.

Resend API along with SDK that is compatible with both JS and Python then sends this HTML to the bulk audience.

Section 5

Introduction to Resend

Learn how to send an email using React Email and the Resend Node.js SDK

Install depencies

Get the @react-email/components package and the Resend Node.js SDK.

text
npm install resend @react-email/components

Create an email using React

text
import * as React from 'react';
import { Html, Button } from "@react-email/components";

export function Email(props) {
  const { url } = props;

  return (
    <Html lang="en">
      <Button href={url}>Click me</Button>
    </Html>
  );
}

export default Email;

Send email

text
import { Resend } from 'resend';
import { Email } from './email';

const resend = new Resend('RESEND_API_KEY');

await resend.emails.send({
  from: 'you@example.com',
  to: 'user@gmail.com',
  subject: 'hello world',
  react: <Email url="https://example.com" />,
});

You can get the API key from the resend dashboard after creating the project.

Section 6

Language Compatibility

Resend is compatible with most of the programming languages

  • Node.js
  • Ruby
  • Go
  • Python
  • Rust
  • Java
  • Elixir

Amazingly, resend provides a wide range of support for programming languages.

https://resend.com/docs/introduction?source=post_page-----6e6c9f5f331a--------------------------------

Section 7

How to get started

Here is the fastest way to create email and send bulk emails using resend.

  • Create resend account
  • Add a domain if have
  • Grab API key
  • Install resend SDK you can use resend API as well
  • Import API key
  • Create a resend instance using the API key and SDK
  • Invoke the resend send button by sending the email HTML, sender to the recipient address.

That’s it, this might sound too much but trust me as compared to another existing platform this is the easiest one.

Just a couple of methods and you are ready to send bulk emails.

Section 8

Art of Crafting Emails

Craft any kind of email, customer signup email, newsletter email, or forget password email.

React email package is good enough to create emails and get the HTML format as the output.

This makes email easy to customise, extend, and send over the HTTP methods, allows analysis of the content, compresses the file, and adds attachments.

Here are the 10+ react email crafted emails

https://demo.react.email/preview/notifications/vercel-invite-user?source=post_page-----6e6c9f5f331a--------------------------------

Do check this as it provides tonnes of examples using react-email.

Section 9

API Key

Using resend SDK you will require an API key and to grab it go to the below link.

https://resend.com/api-keys

Send Test Email

Once all the setup and API key is completed send the test email.

If you using Next.js, prefer using resend SDK and use the serverless function to make an API call.

https://resend.com/docs/dashboard/emails/send-test-emails?source=post_page-----6e6c9f5f331a--------------------------------

text
import { Resend } from 'resend';

const resend = new Resend('re_123456789');

module.exports = async() => {
  await resend.emails.send({
    from: 'Acme <onboarding@resend.dev>',
    to: ['delivered@resend.dev'],
    subject: 'hello world',
    text: 'it works!',
    attachments: [
      {
        filename: 'invoice.pdf',
        content: invoiceBuffer,
      },
    ],
    headers: {
      'X-Entity-Ref-ID': '123456789',
    },
    tags: [
      {
        name: 'category',
        value: 'confirm_email',
      },
    ],
  });
}

Resend send email method that includes attachments, headers and tags as well and we can do the same for bulk audiences as well.

Send Batch Emails

text
import { Resend } from 'resend';

const resend = new Resend('re_123456789');

await resend.batch.send([
  {
    from: 'Acme <onboarding@resend.dev>',
    to: ['foo@gmail.com'],
    subject: 'hello world',
    html: '<h1>it works!</h1>',
  },
  {
    from: 'Acme <onboarding@resend.dev>',
    to: ['bar@outlook.com'],
    subject: 'world hello',
    html: '<p>it works!</p>',
  },
]);

Again, the method looks straightforward and pretty easy to use.

Manage Audience

Audience management is also straightforward like basic CRUD operations.

text
import { Resend } from 'resend';

const resend = new Resend('re_123456789');

resend.contacts.create({
  email: 'steve.wozniak@gmail.com',
  firstName: 'Steve',
  lastName: 'Wozniak',
  unsubscribed: false,
  audienceId: '23996a5b-4992-4247-a42e-102ffd6f25bd',
});
Retrieve

using create method and passing the user data along with audienceId will help to create the audience.

The audience section manages the user under one roof.

For audienceId, go to the resend audience admin page and grab the audienceId.

Section 10

Add a Domain

Resend need you to verify the domain using DNS to send the email on behalf of your domain email address.

Add domain to this link easily to authenticate the sender email address, this is an important task to avoid getting your emails in the user spam folder.

https://resend.com/domains

Logs

Log page to view all the emails send using resend. It also brings the bounced emails, email preview, sender address, timestamp, and email status such as bounced or delivered.

https://resend.com/domains

Pricing

20$/month might seem too high but it’s good because of 50,000 emails/month, unlimited domains, 3 days retention as well and a lot more.

https://resend.com/pricing?source=post_page-----6e6c9f5f331a--------------------------------

Conclusion

This is the product overview of Resend, I hope you all like it and will give it a try.

Resend is doing a good job and I love their SDK, product and easy-to-use things. We are using resend for our platform iHateReading as well.

That’s it, see you in the next one

Shrey

External Links (35)

Explore topics

More in

Weekly letter

Subscribe to iHateReading

Our once-a-week newsletter on programming, jobs, AI, and building products online.

Our once a week newsletter on Programming, Jobs, AI, and Business