npm package: @sparkz-community/messenger-server-lib
Description: [![Build Status](https://travis-ci.org/feathersjs/ir-mailer-server.png?branch=master)](https://travis-ci.org/feathersjs/ir-mailer-server) [![Code Climate](https://codeclimate.com/github/feathersjs/ir-mailer-server/badges/gpa.svg)](https://codeclimate.com/
Author: Sparkz Community
Latest version: 0.2.0

# ir-mailer-server

[![Build Status](https://travis-ci.org/feathersjs/ir-mailer-server.png?branch=master)](https://travis-ci.org/feathersjs/ir-mailer-server)
[![Code Climate](https://codeclimate.com/github/feathersjs/ir-mailer-server/badges/gpa.svg)](https://codeclimate.com/github/feathersjs/ir-mailer-server)
[![Test Coverage](https://codeclimate.com/github/feathersjs/ir-mailer-server/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/ir-mailer-server/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/ir-mailer-server.svg?style=flat-square)](https://david-dm.org/feathersjs/ir-mailer-server)
[![Download Status](https://img.shields.io/npm/dm/ir-mailer-server.svg?style=flat-square)](https://www.npmjs.com/package/ir-mailer-server)

> 

## Installation

```
npm install ir-mailer-server --save
```

## Documentation

TBD

## Complete Example

Here's an example of a Feathers server that uses `ir-mailer-server`. 

```js
const feathers = require('@feathersjs/feathers');
const plugin = require('messenger-server-lib');

// Initialize the application
const app = feathers();

// Initialize the plugin
app.configure(plugin());
```

#### Server side `default.js` configuration example:

```js
  sms: {
    default: 'twilio',
    verifyResetUrl: lget(process.env, 'SMS_URL', clientUrl || serverUrl),
    twilio: {
      from: lget(process.env, 'TWILIO_FROM_PHONE', lget(process.env, 'FROM_NUMBER', '+15005550006')),
      apiKey: lget(process.env, 'TWILIO_API_KEY'),
      domain: lget(process.env, 'TWILIO_DOMAIN')
    },
  },
  mailer: {
    default: lget(process.env, 'MAILER_DEFAULT', 'mailgun'),
    from: lget(process.env, 'FROM_EMAIL', 'account-management@sparkz.community.com'),
    verifyResetUrl: lget(process.env, 'MAILER_URL') || clientUrl || serverUrl,
    helpEmail: lget(process.env, 'HELP_EMAIL') || 'account-management@sparkz.community.com',
    logo: lget(process.env, 'MAILER_LOGO') || 'default_url',
    mailgun: {
      host: lget(process.env, 'MAILGUN_HOST', 'smtp.mailgun.org'),
      port: lget(process.env, 'MAILGUN_PORT', 587),
      secure: false, // use SSL
      auth: {
        user: lget(process.env, 'MAILGUN_USER', 'sandbox user from mailgun.org'),
        pass: lget(process.env, 'MAILGUN_PASS', 'blahblahblah')
      },
      tls:{
        ciphers:'SSLv3'
      }
    },
    sendgrid: {
      host: lget(process.env, 'SENDGRID_HOST', 'smtp.sendgrid.net'),
      port: lget(process.env, 'SENDGRID_PORT', 587),
      secure: true,
      auth: {
        // apikey: lget(config, 'sendgrid.apiKey')
        apiUser: lget(process.env, 'SENDGRID_API_USER'),
        apiKey: lget(process.env, 'SENDGRID_API_KEY')
      }
    },
    ses: {
      host: lget(process.env, 'SES_HOST', 'email-smtp.us-west-2.amazonaws.com'),
      port: lget(process.env, 'SES_PORT', 587),
      secure: true,
      auth: {
        user: lget(process.env, 'SES_SMTP_USER'),
        pass: lget(process.env, 'SES_SMTP_PASS')
      }
    },
    sparkpost: {
      host: lget(process.env, 'SPARKPOST_HOST', 'smtp.sparkpostmail.com'),
      port: lget(process.env, 'SPARKPOST_PORT', 587),
      secure: false,
      ignoreTLS: false,
      auth: {
        user: lget(process.env, 'SPARKPOST_USER', 'SMTP_Injection'),
        pass: lget(process.env, 'SPARKPOST_API_KEY', 'Spark Key')
      },
      tls:{
        ciphers:'SSLv3'
      }
    }
  }
```

## License

Copyright (c) 2018

Licensed under the [MIT license](LICENSE).