# architect-mailer

> architect mailer component

Latest version **1.1.1** (published 2023-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install architect-mailer
pnpm add architect-mailer
yarn add architect-mailer
bun add architect-mailer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-03-29 |
| First published | 2022-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jerome creignou |
| Maintainers | jcreigno |
| Keywords | architect, mailer |

## Links

- npm: https://www.npmjs.com/package/architect-mailer
- Repository: https://github.com/bimedia-fr/architect-mailer
- Homepage: https://github.com/bimedia-fr/architect-mailer#readme
- Issues: https://github.com/bimedia-fr/architect-mailer/issues
- npm.io page: https://npm.io/package/architect-mailer

## Dependencies (1)

- [nodemailer](https://npm.io/package/nodemailer.md) ^6.7.6

## 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

- 1.1.1 (latest) — 2023-03-29
- 1.1.0 — 2022-07-01
- 1.0.0 — 2022-07-01

## README

# architect-mailer  [![NPM version](https://img.shields.io/npm/v/architect-mailer.svg)](https://www.npmjs.com/package/architect-mailer)

expose mailer service as architect plugin.

### Installation

```sh
npm install --save architect-mailer
```
### Config Format 

```js
{
  packagePath: 'architect-mailer',
  transport: {
    tls: {
        rejectUnauthorized: false,
    },
    ignoreTLS: true,
    secure: false,
    port: 25,
  },
  mail: {
    config1: {
        from : 'noreply@example.com',
    }
  }
}
```

### Usage

Boot [Architect](https://github.com/c9/architect) :

```js
var path = require('path');
var architect = require("architect");

var configPath = path.join(__dirname, "config.js");
var config = architect.loadConfig(configPath);

architect.createApp(config, function (err, app) {
    if (err) {
        throw err;
    }
    console.log("app ready");
});
```


And use the service in your app :

```js
module.exports = function setup(options, imports, register) {
    var mailer = imports.mailer;

    // send mail
    mailer.config1.sendMail({
        to: 'someone@example.com',
        subject: 'this the mail subject',
        html: '<p>html message</p>'
    }).then(() => {
        console.log('mail sent !');
    });
    
    register();
};
// Consume rest plugin
module.exports.consumes=['mailer'];
```



### Options
* tansport : see [nodemailer smtp](https://nodemailer.com/smtp/) or [nodemailer other transports](https://nodemailer.com/transports/)
* mail : a hash of configurations see nodemailer [message configuration](https://nodemailer.com/message/)
* throttle: add a delay in ms when mail is sent to prevent flooding transport. (default: 0)

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