Skip to content

Commit

Permalink
Merge branch 'release-1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Feb 13, 2016
2 parents 748daed + f545439 commit 6be7e25
Show file tree
Hide file tree
Showing 29 changed files with 2,571 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage
node_modules
.DS_Store
npm-debug.log
.env
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage
node_modules
.DS_Store
npm-debug.log
test
.travis.yml
.editorconfig
benchmarks
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: node_js
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
node_js:
- 5.3.0
- 4.0.0
sudo: false
install:
- npm install --no-optional
notifications:
slack:
secure: m91zkX2cLVDRDMBAUnR1d+hbZqtSHXLkuPencHadhJ3C3wm53Box8U25co/goAmjnW5HNJ1SMSIg+DojtgDhqTbReSh5gSbU0uU8YaF8smbvmUv3b2Q8PRCA7f6hQiea+a8+jAb7BOvwh66dV4Al/1DJ2b4tCjPuVuxQ96Wll7Pnj1S7yW/Hb8fQlr9wc+INXUZOe8erFin+508r5h1L4Xv0N5ZmNw+Gqvn2kPJD8f/YBPpx0AeZdDssTL0IOcol1+cDtDzMw5PAkGnqwamtxhnsw+i8OW4avFt1GrRNlz3eci5Cb3NQGjHxJf+JIALvBeSqkOEFJIFGqwAXMctJ9q8/7XyXk7jVFUg5+0Z74HIkBwdtLwi/BTyXMZAgsnDjndmR9HsuBP7OSTJF5/V7HCJZAaO9shEgS8DwR78owv9Fr5er5m9IMI+EgSH3qtb8iuuQaPtflbk+cPD3nmYbDqmPwkSCXcXRfq3IxdcV9hkiaAw52AIqqhnAXJWZfL6+Ct32i2mtSaov9FYtp/G0xb4tjrUAsDUd/AGmMJNEBVoHtP7mKjrVQ35cEtFwJr/8SmZxGvOaJXPaLs43dhXKa2tAGl11wF02d+Rz1HhbOoq9pJvJuqkLAVvRdBHUJrB4/hnTta5B0W5pe3mIgLw3AmOpk+s/H4hAP4Hp0gOWlPA=
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Contributing

In favor of active development we accept contributions from everyone. You can contribute by submitting a bug, creating pull requests or even by improving documentation.

Below is the guide to be followed strictly before submitting your pull requests.
http://adonisjs.com/docs/2.0/contributing
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Adonis Mail

[![Gitter](https://img.shields.io/badge/+%20GITTER-JOIN%20CHAT%20%E2%86%92-1DCE73.svg?style=flat-square)](https://gitter.im/adonisjs/adonis-framework)
[![Trello](https://img.shields.io/badge/TRELLO-%E2%86%92-89609E.svg?style=flat-square)](https://trello.com/b/yzpqCgdl/adonis-for-humans)
[![Version](https://img.shields.io/npm/v/adonis-mail.svg?style=flat-square)](https://www.npmjs.com/package/adonis-mail)
[![Build Status](https://img.shields.io/travis/adonisjs/adonis-mail/master.svg?style=flat-square)](https://travis-ci.org/adonisjs/adonis-mail)
[![Coverage Status](https://img.shields.io/coveralls/adonisjs/adonis-mail/master.svg?style=flat-square)](https://coveralls.io/github/adonisjs/adonis-mail?branch=master)
[![Downloads](https://img.shields.io/npm/dt/adonis-mail.svg?style=flat-square)](https://www.npmjs.com/package/adonis-mail)
[![License](https://img.shields.io/npm/l/adonis-mail.svg?style=flat-square)](https://opensource.org/licenses/MIT)

> :pray: This repository contains email sending facilities for adonis framework.
Mail provider has support for several drivers to send email from your adonis app.

1. SMTP
2. Amazon SES
3. Mandrill
4. Log ( for testing emails )

## Table of Contents

* [Team Members](#team-members)
* [Getting Started](#getting-started)
* [Contribution Guidelines](#contribution-guidelines)

## <a name="team-members"></a>Team Members

* Harminder Virk ([Caffiene Blogging](http://amanvirk.me/)) <virk.officials@gmail.com>

## <a name="getting-started"></a>Getting Started

```bash
$ npm i --save adonis-mail-provider
```

next register the provider in your `bootstrap/app.js` file.

```bash
const providers = [
'adonis-mail-provider/providers/MailProvider'
]

const aliases = {
Mail: 'Adonis/Addons/Mail'
}
```

Example configuration file can be downloaded from [examples/mail.js](examples/mail.js), and should be kept inside `config/mail.js`.

[Official Documentation](http://adonisjs.com/docs/mail)

## <a name="contribution-guidelines"></a>Contribution Guidelines

In favor of active development we accept contributions for everyone. You can contribute by submitting a bug, creating pull requests or even improving documentation.

You can find a complete guide to be followed strictly before submitting your pull requests in the [Official Documentation](http://adonisjs.com/docs/2.0/contributing).
84 changes: 84 additions & 0 deletions examples/mail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
'use strict'

const Helpers = use('Helpers')
const Env = use('Env')

module.exports = {
/*
|--------------------------------------------------------------------------
| Driver
|--------------------------------------------------------------------------
|
| driver defines the default driver to be used for sending emails. Adonis
| has support for 'mandrill', 'smtp', 'ses' and 'log' driver.
|
*/
driver: Env.get('MAIL_DRIVER', 'smtp'),

/*
|--------------------------------------------------------------------------
| SMTP
|--------------------------------------------------------------------------
|
| Here we define configuration for sending emails via SMTP.
|
*/
smtp: {
pool: true,
port: 2525,
host: '',
secure: false,
auth: {
user: Env.get('MAIL_USERNAME'),
pass: Env.get('MAIL_PASSWORD')
},
maxConnections: 5,
maxMessages: 100,
rateLimit: 10
},

/*
|--------------------------------------------------------------------------
| Mandrill
|--------------------------------------------------------------------------
|
| Here we define api options for mandrill. Mail provider makes use of
| mandrill raw api, which means you cannot set email body specific
| options like template, tracking_domain etc.
|
*/
mandrill: {
apiKey: Env.get('MANDRILL_APIKEY'),
async: false,
ip_pool: 'Main Pool'
},

/*
|--------------------------------------------------------------------------
| Amazon SES
|--------------------------------------------------------------------------
|
| Here we define api credentials for Amazon SES account. Make sure you have
| verified your domain and email address, before you can send emails.
|
*/
ses: {
accessKeyId: Env.get('SES_KEY'),
secretAccessKey: Env.get('SES_SECRET'),
region: 'us-east-1',
rateLimit: 10
},

/*
|--------------------------------------------------------------------------
| Log
|--------------------------------------------------------------------------
|
| Log driver is mainly for testing your emails expectations. Emails are
| written inside a log file, which can be used for inspection.
|
*/
log: {
toPath: Helpers.storagePath('logs/mail.eml')
}
}
54 changes: 54 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "adonis-mail-provider",
"version": "1.0.0",
"description": "Mail provider for adonis framework and has support for all common mailing services to send emails",
"main": "index.js",
"directories": {
"example": "examples",
"test": "test"
},
"scripts": {
"test": "npm run standard && istanbul cover _mocha --report lcovonly -- -R spec test/unit && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"standard": "standard src/**/*.js src/**/**/*.js src/**/**/**/*.js test/**/*.js providers/*.js"
},
"keywords": [
"adonis",
"adonis-framework"
],
"author": "adonisjs",
"license": "MIT",
"devDependencies": {
"adonis-fold": "^2.0.1",
"chai": "^3.5.0",
"co-mocha": "^1.1.2",
"coveralls": "^2.11.6",
"cz-conventional-changelog": "^1.1.5",
"got": "^6.1.1",
"istanbul": "^0.4.2",
"mailparser": "^0.5.3",
"mocha": "^2.4.5",
"nodemailer-ses-transport": "^1.3.0",
"standard": "^6.0.4"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"co-fs-extra": "^1.1.0",
"node-exceptions": "^1.0.1",
"nodemailer": "^2.1.0"
},
"peerDependencies": {
"adonis-fold": "^2.0.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/adonisjs/adonis-mail.git"
},
"bugs": {
"url": "https://github.com/adonisjs/adonis-mail/issues"
},
"homepage": "https://github.com/adonisjs/adonis-mail#readme"
}
31 changes: 31 additions & 0 deletions providers/MailProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict'

/**
* adonis-framework
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

const ServiceProvider = require('adonis-fold').ServiceProvider

class MailProvider extends ServiceProvider {

* register () {
const Mail = require('../src/Mail')
this.app.singleton('Adonis/Addons/Mail', function (app) {
const View = app.use('Adonis/Src/View')
const Config = app.use('Adonis/Src/Config')
return new Mail(View, Config)
})
this.app.manager('Adonis/Addons/Mail', Mail)
this.app.bind('Adonis/Addons/MailBaseDriver', function () {
return require('../src/Mail/drivers/BaseDriver')
})
}

}

module.exports = MailProvider

0 comments on commit 6be7e25

Please sign in to comment.