Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benoitclaveau/damless-nodemailer

Nodemailer service for dambreaker
https://github.com/benoitclaveau/damless-nodemailer

Last synced: 19 days ago
JSON representation

Nodemailer service for dambreaker

Awesome Lists containing this project

README

        

# damless-nodemailer
Use [nodemailer](https://www.npmjs.com/package/nodemailer) to send email from your [Dam Less server](https://www.npmjs.com/package/damless).

## Features

* [DamLess](https://www.npmjs.com/package/damless)
* [Nodemailer](https://www.npmjs.com/package/nodemailer)

### Add the nodemailer parameters in config.json

```json
{
"nodemailer": {
"transport": {
"service": "service name",
"auth": {
"user": "user",
"pass": "password"
}
},
"dkim": {
"domainName": "your domain.com",
"keySelector": "123456",
"privateKey": "./key.pem"
},
"from": "your e-mail address"
}
```

### Declare and inject nodemailer service

```js
const DamLess = require("damless");
const damless = new DamLess();

damless.inject("mailer", "damless-nodemailer");
```

## API

* send(mailerOptions)

```js
const mailOptions = {
from: 'Fred Foo ✔ ', // sender address
to: '[email protected], [email protected]', // list of receivers
subject: 'Hello ✔', // Subject line
text: 'Hello world ✔', // plaintext body
html: 'Hello world ✔' // html body
};

return mailer.send(mailOptions);
```

## Installation

```bash
$ npm install damless-nodemailer
```