Skip to content

fredmaiaarantes/email-resend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resend Client Email

f7labs:email-resend is a package that simplifies the process of sending emails using Meteor. It provides a plug-and-play integration with Resend, leveraging the powerful email package from Meteor.

Installation

To install f7labs:email-resend, simply execute the following command:

meteor add f7labs:email-resend

Usage

Resend

Create a Resend account, create an API Key and verify your domain.

Configuration

To get started quickly with using Resend as the email provider for Meteor, you only need to configure your API Key in your settings. Modify your settings file as follows:

{
  "packages": {
    "f7labs:email-resend": {
      "from": "[email protected]",
      "apiKey": "re_aAAaAAAA_0a0AaAAaAaAaaaaaAa0AaAAA"
    }
  }
}

Alternatively, if you prefer to set the from field dynamically, you can do so by either configuring it in the settings or by passing it as a prop when calling the email manually.

Usage

Automatically used when calling methods from the Email and Accounts Password packages. For example when calling Accounts functions as Accounts.sendVerificationEmail(), Accounts.forgotPassword(), Accounts.sendResetPasswordEmail(), and so on.

You can also use this package to send emails directly. Here's an example of how to do it:

import { Meteor } from 'meteor/meteor';
import { sendEmail } from 'meteor/f7labs:email-resend';

Meteor.methods({
  sendMyRandomEmail({ to, subject, content }) {
    sendEmail({
      to,
      subject,
      content,
    })
      .then(() => {
        console.log(`Email sent to ${to}`);
      })
      .catch(error => {
        console.error(`Error sending email to ${to}`, error);
      });
  }
});

You can optionally provide the from field in the sendEmail function if you haven't set it in the package settings.

Limitations

Please note that the Meteor email package needs to be in version 2.2 or above, which corresponds to Meteor version 2.4.

License

This project is licensed under the MIT license.

About

Integrates Meteor's Email package with Resend

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published