Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
blueprints/mailer
config
lib
scripts
test
.babelrc
.codeclimate.yml
.eslintignore
.eslintrc
.gitattributes
.gitignore
.travis.yml
CHANGELOG.md
README.md
denali-build.js
package.json
yarn.lock

README.md

Denali Mailer

NPM version Build Status

An awesome addon built on the Denali framework.

Usage

Install within your app:

npm install --save denali-mailer

Create a mailer you'd like to use:

// app/mailers/welcome/mailer.js
import { Mailer } from 'denali-mailer';

export default WelcomeMailer extends Mailer {
  from = 'myemail@something.com';

  to(data) {
    return data.email;
  }
}

And define your templates in app/mailers/welcome/tempalte.{html,txt} which get access to the data via ejs.

Use in your action via this.service('mailer'):

import ApplicationAction from './application';

export default class IndexAction extends ApplicationAction {

  serializer = false;

  respond() {
    let mailer = this.service('mailer');
    let data = { email: 'hello@user.com' };
    
    mailer.send('welcome', data);
    
    return { message: 'Welcome to Denali!' };
  }

}

Developing

  1. Clone the repo down
  2. npm install
  3. denali server
  4. Hit localhost:3000

Tests

$ denali test
You can’t perform that action at this time.