-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from joshferrell/feat/hapi-plugin
Feat/hapi plugin
- Loading branch information
Showing
102 changed files
with
28,162 additions
and
116,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"sourceMaps": "inline", | ||
"presets": [ | ||
"env", | ||
"stage-3", | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"plugins": ["jest"], | ||
"extends": [ | ||
"airbnb", | ||
"plugin:jest/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"indent": [2, 4], | ||
"react/jsx-indent": [2, 4], | ||
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], | ||
"comma-dangle": ["error", "never"], | ||
"jsx-a11y/no-redundant-roles": 2, | ||
"react/jsx-indent-props": [2, 4], | ||
"no-confusing-arrow": ["error", {"allowParens": true}], | ||
"import/no-duplicates": 0, | ||
"import/prefer-default-export": 1, | ||
"linebreak-style": 0, | ||
"no-warning-comments": ["warn"], | ||
"no-underscore-dangle": [2, { "allow": ["__"] }], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
*.env | ||
|
||
# built babel directory | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# ![Hapi Maily](http://i.imgur.com/Ko5GT7a.png?1) Hapi Maily | ||
[![Join the chat at https://gitter.im/hapi-smiles/hapi-maily](https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square)](https://gitter.im/hapi-smiles/hapi-maily?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Build Status](https://img.shields.io/travis/joshferrell/hapi-maily/master.svg?style=flat-square)](https://travis-ci.org/joshferrell/hapi-maily) | ||
[![Coverage Status](https://img.shields.io/coveralls/joshferrell/hapi-maily/master.svg?style=flat-square)](https://coveralls.io/github/joshferrell/hapi-maily?branch=master) | ||
|
||
This is a plugin for sending out emails by defining a custom handler. When the route is hit, an | ||
email is sent to the user in the email attribute of the payload. | ||
|
||
## Install | ||
|
||
You can add the module to your Hapi Server using npm or yarn | ||
```sh | ||
npm install hapi-maily --save | ||
# or | ||
yarn add hapi-maily | ||
``` | ||
|
||
## Documentation | ||
### [Options Reference](./docs/options-reference.md) | ||
|
||
Read about options for the plugin and route options. Useful if you wish to extend the plugin | ||
beyond the setup used in the [example server](../server). | ||
|
||
[Read More](./docs/options-reference.md) | ||
|
||
## Quick Start | ||
|
||
In your Hapi apps main JavaScript file add the following code to a created Hapi server object. | ||
You will also add the routes for your API as described on the [hapijs documentation](http://hapijs.com). | ||
|
||
For an example server see the [example hapi server](../server). To see a simple implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# 1.0.0 Options Reference | ||
|
||
## Plugin Options | ||
|
||
### Required | ||
* `transport`: (function) A nodemailer transporter that has been configured | ||
* `fromAddress`: (string) The email address that emails will be sent from. | ||
|
||
### Optional | ||
* `env`: (string enum) The current environment that server is running in, valid options below. | ||
* development | ||
* local | ||
* production | ||
* `templateSettings`: (object) Settings that will be passed to all templates, see theme options below. | ||
|
||
## Route Options | ||
|
||
### Required | ||
* `component`: (function) A React component that uses [mjml](http://mjml.io) for rendering | ||
* `subject`: (string) A email subject that will be sent to the email client. | ||
|
||
## Template Settings | ||
|
||
All template options are optional. If address, header image, or contact is not passed to the plugin, then props are required for their components. | ||
|
||
If a value is set for anything, all values will be overwritten. For instance, if a color template setting is set, secondary, danger, success, etc. will no longer be available unless used in the new value. | ||
|
||
If a setting is included, then the nested values will be required if marked as such. | ||
|
||
* `colors`: (object) An object that includes a key (e.g. primary) and a hex string (e.g. `'#ECECEC'`). | ||
* `primary`: (string) A primary color to be used, **required** | ||
* `header`: (object) An object that affects the header settings | ||
* `img`: (object) An object that includes image data for headers | ||
* `src`: (string) A url for the image source **required** | ||
* `alt`: (string) An alt tag describing the image **required** | ||
* `address`: (object) An object that has address information for use in address components | ||
* `name`: (string) **required** | ||
* `addressLine1`: (string) **required** | ||
* `addressLine2`: (string) **required** | ||
* `city`: (string) **required** | ||
* `state`: (string) **required** | ||
* `zip`: (string) **required** | ||
* `country` (string) **required** | ||
* `contact` (array[object]) An array of objects with contact information | ||
* `name`: (string) Name describing the contact method | ||
* `value`: (string) Value of what will actually be displayed to user **required** | ||
* `href`: (string) Link for the contact (e.g. `'mailto:noreply@gmail.com'`) | ||
* `type`: (string enum) The type of contact. See below for possible values. **required** | ||
* phone | ||
* website | ||
* fax | ||
|
||
### Default Template Settings | ||
|
||
* `colors`: An object including possible color types | ||
* `primary`: <span style="display: inline-block; background-color: #9b59b6; width: 15px; height: 15px; margin-right:5px;"></span>#9b59b6 | ||
* `secondary`: <span style="display: inline-block; background-color: #95a5a6; width: 15px; height: 15px; margin-right:5px;"></span>#95a5a6 | ||
* `danger`: <span style="display: inline-block; background-color: #f64747; width: 15px; height: 15px; margin-right:5px;"></span>#f64747 | ||
* `success`: <span style="display: inline-block; background-color: #2ecc71; width: 15px; height: 15px; margin-right:5px;"></span>#2ecc71 | ||
* `warning`: <span style="display: inline-block; background-color: #e67e22; width: 15px; height: 15px; margin-right:5px;"></span>#e67e22 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.