Socket
Book a DemoInstallSign in
Socket

fastify-mailgun

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-mailgun

Fastify plugin that adds MailGun support with incoming webhooks.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

fastify-mailgun

Travis Codacy Badge Known Vulnerabilities Coverage Status Greenkeeper badge js-standard-style

Fastify plugin that adds MailGun support with incoming webhooks. Under the hood the mailgun-js module is used.

Installation

$ npm install fastify-mailgun

Usage

fastify.register(require('fastify-mailgun'), {
    prefix: '/mailgun', // register your webhook (in MailGun) with '/mailgun/webhooks'
    apiKey: 'apikey-...', // your MailGun API Key
    domain: 'mydomain.com',  // you domain name
    webhookHandler: async function (data) {
      // handle you webhook data

      // example: retrieve the message from mailgun store
      const storedMessage = await fastify.mailgun.getStoredMessage({ url: data.storage.url })

      // example: send a new mail using the mailgun client
      await fastify.mailgun.client.messages().send(...)

      return true
    }
  })

Maintainers

Osmond van Hemert Github Web

Contributing

If you would like to help out with some code, check the details.

Not a coder, but still want to support? Have a look at the options available to donate.

License

Licensed under MIT.

Keywords

fastify

FAQs

Package last updated on 28 Nov 2019

Did you know?

Socket

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