curli-nodemailer-module
v0.0.1-beta.0
Published
Nodemailer (email sender) implementation for the Curli framework
Downloads
2
Maintainers
Readme
curli-nodemailer-module
Nodemailer implementation for the Curli framework.
Installation
Install by npm
npm install --save curli-nodemailer-module
Basic Usage
1 - In the configurations file, declare de followings properties:
@TRANSPORT_TYPE: (string) The type of transport we will use: 'smtp' | 'ses' | 'sendmail' @TRANSPORTS_CONFIGURATION (object) An object with the configuration for the types. A configuration for the type selected must be present.
Eg:
{ 'transporter_smtp': { 'host': 'smtp.gmail.com', 'port': 587, 'secure': false, 'user': '[email protected]', 'pass': 'password', } }
2 - Add the module definer:
import {NodemailerModule} from "curli-nodemailer-module";
app.addModules(new NodemailerModule(app));
3 - Send an email
await this.container.get('email').send({
from: "[email protected]",
to: "[email protected]",
subject: "Message title",
text: "Plaintext version of the message",
html: "<p>HTML version of the message</p>"
});
Commands
npm run build
: Build the project (Curli Mikro Orm).npm run build:clean
: Delete first the dist folder and build it.npm run clean
: Delete the dist folder.npm run test
: Execute the tests.npm run test:coverage
: Execute the tests and calculate the coverage.npm run lint
: Check the code using the rules in .eslintre.jsnpm run lint:fix
: Check the code and try to fix it.
License
MIT