Socket
Socket
Sign inDemoInstall

fastify-nodemailer-plugin

Package Overview
Dependencies
5
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fastify-nodemailer-plugin

Nodemailer for Fastify


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

fastify-nodemailer-plugin

Version

Nodemailer for Fastify

Installation

yarn add fastify-nodemailer-plugin
or
npm install fastify-nodemailer-plugin

Usage

Register config and example config and more nodemailer

fastify.register(fastifyNodemailer, {
  service: "gmail",
  auth: {
    user: "testuser@gmail.com",
    pass: "secretpassword",
  },
});

If you use with TypeScript , you have to give this type to avoid error

import Fastify, { FastifyInstance } from "fastify";

const fastify: FastifyInstance = Fastify();

Use with fastify decorate

fastify.get("/", async (request, reply) => {
  fastify.nodemailer.sendMail({
    from: "testuser@gmail.com",
    to: request.body.email,
    subject: "Test User",
    text: "Hello World 👋",
  });
  return "Mail has send.";
});

Use with reply decorate

fastify.get("/", async (request, reply) => {
  reply.nodemailer.sendMail({
    from: "testuser@gmail.com",
    to: request.body.email,
    subject: "Test User",
    text: "Hello World 👋",
  });
  return "Mail has send.";
});

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Keywords

FAQs

Last updated on 18 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc