rf-api-mailer
Gets Mails settings and starts simpleTemplateMailer
.
Getting Started
npm install rf-api-mailer
Init the service
var mailerOptions = transporter: mainOptions // nodemailer transporter defaultLanguage: 'en' contactMail: 'your@contactMail.com' // optional translationsPath: 'mail/translations' templatesPath: 'mail/templates' inlineAttribute: 'inline' // all html tags with this attribute will be "inlined" by "inline-source"); var services: sendMail: startmailerOptionssendMail
Assuming, that templates and translations are in one folder you might pass the path options direct like:
var mailerOptions = transporter: mainOptions // nodemailer transporter defaultLanguage: 'en' contactMail: 'your@contactMail.com' // optional); var mailPath = 'mail'; var services: sendMail: startmailerOptions mailPathsendMail
Use the service
var template = name: 'newsletter' language: "en" data: test: 234 // data from your app inserted in template inlineAttribute: "inline" // optional: individual inline configuration; var mailOptions = to:"max.mustermann@gmx.net"; // nodemailer options // simple exampleservices; // with rf-apiAPI
Development
Install the dev tools with
npm install
Then you can runs some test cases and eslint with:
npm test
Legal Issues
- License: MIT
- Author: Rapidfacture GmbH