quave:email-resend

v0.1.0Published 13 hours ago

quave:email-resend

quave:email-resend is a Meteor package that provides a plug-and-play integration with Resend.

Why

It is designed to simplify sending emails with Meteor using Resend.

We use the email package from Meteor and register Email.customTransport, so Email.send and Email.sendAsync use Resend when this package is the active email transport.

Installation

meteor add quave:email-resend

Usage

Configuration

Configure your Resend API key and default sender in Meteor settings:

1{
2  "packages": {
3    "quave:email-resend": {
4      "from": "noreply@yourdomain.com",
5      "apiKey": "re_..."
6    }
7  }
8}

For local development without sending email, set devMode:

1{
2  "packages": {
3    "quave:email-resend": {
4      "devMode": true,
5      "devModeOnlySubject": true,
6      "from": "noreply@yourdomain.com"
7    }
8  }
9}

Code usage

If you want to use our code to send emails directly, call sendEmail:

1import { sendEmail } from 'meteor/quave:email-resend';
2
3Meteor.methods({
4  async newEmail({ to, subject, content }) {
5    await sendEmail({
6      to,
7      subject,
8      content,
9    });
10  },
11});

You can provide from as well in the sendEmail function.

License

MIT