# respondence

> A simple hapijs plugin for sending e-mails.

Latest version **0.3.4** (published 2019-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install respondence
pnpm add respondence
yarn add respondence
bun add respondence
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2019-02-19 |
| First published | 2016-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Denmark Dionisio |
| Maintainers | phenelo |
| Keywords | hapi, emailer, nodemailer |

## Links

- npm: https://www.npmjs.com/package/respondence
- Repository: https://github.com/Phenelo/respondence
- Homepage: https://github.com/Phenelo/respondence#readme
- Issues: https://github.com/Phenelo/respondence/issues
- npm.io page: https://npm.io/package/respondence

## Dependencies (1)

- [nodemailer](https://npm.io/package/nodemailer.md) 5.1.x

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

- 0.3.4 (latest) — 2019-02-19
- 0.2.5 — 2017-06-09
- 0.2.4 — 2017-02-05
- 0.2.2 — 2016-12-28
- 0.2.1 — 2016-12-28
- 0.2.0 — 2016-12-28
- 0.1.0 — 2016-12-28

## README

# respondence
[![Build Status](https://travis-ci.org/Phenelo/respondence.svg?branch=master)](https://travis-ci.org/Phenelo/respondence)
[![Coverage Status](https://coveralls.io/repos/github/Phenelo/respondence/badge.svg?branch=master)](https://coveralls.io/github/Phenelo/respondence)
[![Code Climate](https://codeclimate.com/github/Phenelo/respondence/badges/gpa.svg)](https://codeclimate.com/github/Phenelo/respondence)
[![NPM Version](https://badge.fury.io/js/respondence.svg)](https://www.npmjs.com/respondence)
[![Dependency Status](https://david-dm.org/Phenelo/respondence.svg)](https://david-dm.org/Phenelo/respondence)<br>
[![Known Vulnerabilities](https://snyk.io/test/github/phenelo/respondence/badge.svg)](https://snyk.io/test/github/phenelo/respondence)

A simple hapijs plugin for sending e-mails. Uses [nodemailer](https://github.com/nodemailer/nodemailer).

## Usage
```js
const Respondence = require('respondence');
const server = new Hapi.Server();

await server.register({
    plugin: Respondence,
    options: {
        smtp: 'smtps://user%40gmail.com:pass@smtp.gmail.com'
    }
});
```

## Sending email
```js
const mail = {
     from: '"Baroof" <baroof@gmail.com>',
     to: 'foobar@gmail.com',
     subject: 'Foo',
     text: 'A bar without foo is barfoo.'
},

try {
    
    await server.plugins.respondence.send(internals.mail);
}
catch(err) {
    
    console.log(err);
}
```

## Verifying SMTP connection
```js
try {
    
    await server.plugins.respondence.verify();
}
catch(err) {
    
    console.log(err);
}
```

## Registering with a transport plugin
```js
const Mailgun = require('nodemailer-mailgun-transport');

await server.register({
    register: Respondence,
    options: {
        plugin: Mailgun,
        params: {
            auth: {
                api_key: 'api-key1234567890',
                domain: '1234567890.mailgun.org'
            }
        }
    }
});
```
See more transport plugins [here](https://github.com/nodemailer/nodemailer#send-using-a-transport-plugin) and
[nodemailer](https://github.com/nodemailer/nodemailer) for more information.

## Contributing
* Include 100% test coverage.
* Follow the [Hapi coding conventions](http://hapijs.com/styleguide)
* Submit an issue first for significant changes.

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