legends-killer / egg-dynamic-email

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

egg-dynamic-email

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-dynamic-email --save

Usage

// {app_root}/config/plugin.js
exports.eggDynamicEmail = {
  enable: true,
  package: 'egg-dynamic-email',
};

Configuration

// {app_root}/config/config.default.js
exports.eggDynamicEmail = {
  user: '',
  password: '',
  host: '',
  sender: '',
};

see config/config.default.js for more detail.

Example

// {app_root}/app/controller/home.js
 async index() {
   const { ctx } = this
   const res = await ctx.app.email.sendEmail('title','content','receiver', [{data: 'html content', alternative: true}])
 }

Questions & Suggestions

Please open an issue here.

License

MIT

About

License:MIT License


Languages

Language:JavaScript 100.0%