npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vintasend-mailgun

v0.13.3

Published

A VintaSend email notification adapter using [Mailgun](https://www.mailgun.com/) for reliable email delivery with attachment support.

Readme

VintaSend Mailgun Adapter

A VintaSend email notification adapter using Mailgun for reliable email delivery with attachment support.

Installation

npm install vintasend-mailgun mailgun.js form-data

Configuration

import { MailgunNotificationAdapterFactory } from 'vintasend-mailgun';

const adapter = new MailgunNotificationAdapterFactory().create(
   templateRenderer,
   false, // enqueueNotifications
   {
      apiKey: process.env.MAILGUN_API_KEY,
      domain: process.env.MAILGUN_DOMAIN,
      fromEmail: '[email protected]',
      fromName: 'My App', // optional
   }
);

Configuration Options

interface MailgunConfig {
   apiKey: string;        // Mailgun API key
   domain: string;        // Mailgun domain
   fromEmail: string;     // Default sender email address
   fromName?: string;     // Optional sender name
}

Usage

Basic Email

await notificationService.createNotification({
   userId: '123',
   notificationType: 'EMAIL',
   contextName: 'welcome',
   contextParameters: { firstName: 'John' },
   title: 'Welcome!',
   bodyTemplate: '/templates/welcome.pug',
   subjectTemplate: '/templates/subjects/welcome.pug',
   sendAfter: new Date(),
});

Email with Attachments

import { readFile } from 'fs/promises';

await notificationService.createNotification({
   userId: '123',
   notificationType: 'EMAIL',
   contextName: 'invoice',
   contextParameters: { invoiceNumber: 'INV-001' },
   title: 'Your invoice',
   bodyTemplate: '/templates/invoice.pug',
   subjectTemplate: '/templates/subjects/invoice.pug',
   sendAfter: new Date(),
   attachments: [
      {
         file: await readFile('./invoice.pdf'),
         filename: 'invoice.pdf',
         contentType: 'application/pdf',
      },
   ],
});

One-Off Notifications

await notificationService.createOneOffNotification({
   emailOrPhone: '[email protected]',
   firstName: 'Jane',
   lastName: 'Smith',
   notificationType: 'EMAIL',
   contextName: 'order-confirmation',
   contextParameters: { orderNumber: '12345' },
   title: 'Order Confirmation',
   bodyTemplate: '/templates/order-confirmation.pug',
   subjectTemplate: '/templates/subjects/order-confirmation.pug',
   sendAfter: new Date(),
});

Features

  • ✅ Email delivery via Mailgun API
  • ✅ File attachments
  • ✅ One-off notifications
  • ✅ Scheduled notifications
  • ✅ Custom sender name and email
  • ✅ HTML email templates
  • ✅ Multiple attachments per email

API Reference

MailgunNotificationAdapterFactory

class MailgunNotificationAdapterFactory<Config extends BaseNotificationTypeConfig>

Methods:

  • create<TemplateRenderer>(templateRenderer, enqueueNotifications, config) - Create adapter instance

MailgunNotificationAdapter

Properties:

  • key: string - Returns 'mailgun'
  • notificationType: NotificationType - Returns 'EMAIL'
  • supportsAttachments: boolean - Returns true

Methods:

  • send(notification, context) - Send an email with optional attachments

Environment Variables

MAILGUN_API_KEY=key-your-api-key-here
MAILGUN_DOMAIN=mg.example.com
[email protected]
FROM_NAME=My Application

License

MIT