# @node-notifications/transport-mailer

> Mail transport for Notification System

Latest version **3.1.0** (published 2023-06-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @node-notifications/transport-mailer
pnpm add @node-notifications/transport-mailer
yarn add @node-notifications/transport-mailer
bun add @node-notifications/transport-mailer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2023-06-29 |
| First published | 2023-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | and.xdev |
| Maintainers | and.xdev, powercode |
| Keywords | notifications, node |

## Links

- npm: https://www.npmjs.com/package/@node-notifications/transport-mailer
- Repository: https://github.com/powercode-team/notifications-node.git#main
- Homepage: https://github.com/powercode-team/notifications-node/tree/main/packages/transport/mailer#readme
- Issues: https://github.com/powercode-team/notifications-node/issues
- npm.io page: https://npm.io/package/@node-notifications/transport-mailer

## Dependencies (3)

- [nodemailer](https://npm.io/package/nodemailer.md) ^6.0
- [@types/nodemailer](https://npm.io/package/@types/nodemailer.md) ^6.0
- [@node-notifications/core](https://npm.io/package/@node-notifications/core.md) ^3.1.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 3.1.0 (latest) — 2023-06-29
- 3.0.1 — 2023-06-26
- 3.0.0 — 2023-06-20
- 2.1.5 — 2023-03-27
- 2.1.4 — 2023-03-27
- 2.1.3 — 2023-03-27
- 2.1.2 — 2023-03-27
- 2.1.1 — 2023-03-27
- 2.1.0 — 2023-03-27
- 2.0.1 — 2023-03-24

## README

# Notification System mailer transport

## Description

Nodemailer transport for [Notification System](https://www.npmjs.com/package/@node-notifications/core)

## Install

> yarn add @node-notifications/transport-mailer

## Usage

```typescript
import { MemoryStorage, NotificationQueueManager, NotificationService } from '@node-notifications/core';
import { MailDataProvider, SmtpTransport } from '@node-notifications/transport-mailer';

let service: NotificationService;
let queueManager: NotificationQueueManager;

async function main() {
  // Instantiate Notification Service
  service = new NotificationService(
    await new MemoryStorage().initialize(),
    {
      smtp: new SmtpTransport({
        options: {
          host: process.env.MAIL_HOST,
          port: Number(process.env.MAIL_PORT) || undefined,
          auth: {
            user: process.env.MAIL_USER,
            pass: process.env.MAIL_PASS,
          },
        },
        defaults: {
          from: process.env.MAIL_FROM,
        },
        // MailDataProvider - IDataProvider implementation to transform data from `INotification` format to `IMailData` format
      }, new MailDataProvider()),
    },
  );

  // Instantiate Notification Queue Manager
  queueManager = new NotificationQueueManager(service).start();

  // ...

  // Sample usage (data: INotification)
  service.send({ recipient: 'user@mail.test', payload: 'Test Notification', transports: ['smtp'] }).then();
}
```

---
_Source: https://npm.io/package/@node-notifications/transport-mailer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
