open-index/open-npm huggingface dataset:
npm package: @sidehackhq/mail
Description: Simple mail client for JS environments.
Latest version: 2.0.1

# sidehack-mail-js

## Example
### index.js
```js
var Mailer = require('@sidehackhq/mail').Mail;
var TemplateEngine = require('@sidehackhq/mail/lib/TemplateEngine/EmailTemplates').EmailTemplatesTemplateEngine;
var Transport = require('@sidehackhq/mail/lib/Transport/Ses').SesTransport;
var path = require('path');

var mail = new Mailer({
	from: 'FROM',
	subject: 'sidehack-mail-js: testing',
	transport: new Transport({
		key: 'SES_KEY',
		secret: 'SES_KEY',
		amazon: 'https://email.REGION.amazonaws.com' // omitting this will default to `https://email.us-east-1.amazonaws.com`
	}),
	template: new TemplateEngine({
		path: path.join(__dirname, 'templates', 'test'), // points to `templates/test/`, `html.hbs` is required at this path
	}),
});

mail.send({
	to: 'TO', // string or array

	// when using templates, body is an object of parameters to be passed to the template engine
	body: {
		name: 'NAME',
		dob: 'DATE_OF_BIRTH',
	}
})
	.then(() => {
		console.log('Sent!');
	})
	.catch((err) => {
		console.log('Something went wrong!');
		console.log(err);
	})
;
```

### templates/test/html.hbs
```hbs
Hi {{name}}! Your date of birth is {{dob}}.
```