@wolfxlabs/nodemailer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Nodejs Custom SMTP Provider

A nodemailer email provider library for @novu/stateless

Usage

import { NodemailerProvider } from '@novu/nodemailer';

const provider = new NodemailerProvider({
  from: process.env.NODEMAILER_FROM_EMAIL,
  host: process.env.NODEMAILER_HOST,
  user: process.env.NODEMAILER_USERNAME,
  password: process.env.NODEMAILER_PASSWORD,
  port: process.env.NODEMAILER_PORT,
  secure: process.env.NODEMAILER_SECURE,
});

Advanced configuration

To take advantage of the different advanced configurations of TLS options you can set up the following properties with their corresponding environment variable:

  • ignoreTls: NODEMAILER_IGNORE_TLS -> Boolean
# .env
NODEMAILER_IGNORE_TLS=true
  • requireTls: NODEMAILER_REQUIRE_TLS -> Boolean
# .env
NODEMAILER_REQUIRE_TLS=true
  • tlsOptions: NODEMAILER_TLS_OPTIONS -> JSON
# .env
NODEMAILER_TLS_OPTIONS={"rejectUnauthorized":false}
import { NodemailerProvider } from '@novu/nodemailer';

const provider = new NodemailerProvider({
  from: process.env.NODEMAILER_FROM_EMAIL,
  host: process.env.NODEMAILER_HOST,
  user: process.env.NODEMAILER_USERNAME,
  password: process.env.NODEMAILER_PASSWORD,
  port: process.env.NODEMAILER_PORT,
  secure: process.env.NODEMAILER_SECURE,
  ignoreTls: process.env.NODEMAILER_IGNORE_TLS,
  requireTls: process.env.NODEMAILER_REQUIRE_TLS,
  tlsOptions: process.env.NODEMAILER_TLS_OPTIONS,
});

You can read more details of the different possible configurations in Nodemailer documentation

Readme

Keywords

none

Package Sidebar

Install

npm i @wolfxlabs/nodemailer

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

22.6 kB

Total Files

15

Last publish

Collaborators

  • tecklens1