Skip to content

Nodemailer Plugin

This plugin is responsible for registering the required email strategy config for Lucid and uses the Nodemailer library to send emails.

Prerequisites

Installation

To install the Nodemailer plugin, run the following command in your terminal:

Terminal window
npm i @lucidcms/plugin-nodemailer

Configuration

To use the Nodemailer plugin, you need to add it to your lucid.config.ts or lucid.config.js file. You will also need to provide it with the necessary configuration options, such as a Nodemailer transporter and the ‘from’ details so Lucid knows where to send emails from.

lucid.config.ts
import lucid from "@lucidcms/core";
import LucidNodemailer from "@lucidcms/plugin-nodemailer";
export default lucid.config({
// ...other config
plugins: [
LucidNodemailer({
from: {
name: "Lucid",
},
transporter: transporter,
}),
],
});