1.0.11 • Published 4 years ago
inspira-mailgun v1.0.11
inspira-mailgun
Mailgun utilities
HOW TO USE
npm install --save inspira-mailgun
Use Inspira Mailgun - Sent report email
import { InspiraMailgun } from 'inspira-mailgun';
const inspiraMailgun = new InspiraMailgun.InspiraMailgunUtils(domain, Yourkey, { info: LoggerService.logger.info, error: LoggerService.logger.error});
inspiraMailgun.sendReportEmailTo(email)
.then(() => LoggerService.logger.info('Report Mailgun Email sent'));
.catch(e => { LoggerService.logger.error('Failing while sending report Email', e); })
Use Inspira Mailgun - Sent Receive Failures
- Create in your project root directory the following folders /mailgun/db. Here is where the package will create a daily list of failures.
- Get the webhook token and create the webhook in https://app.mailgun.com/app/sending/domains/example.domain.com/webhooks
import { InspiraMailgun } from 'inspira-mailgun';
// https://app.mailgun.com/app/sending/domains/example.domain.com/webhooks
app.use('/mailgun', new InspiraMailgun.routes(KeyFromMailGun).buildRoutes());
HOW TO PUBLISH
Push a change with a new version set in package.json and bitbucket pipeline will automatically publish a new npm package.
NOTE: To understand when the version number needs to change refer to npm documentation
Functionalities
- Sent Email
- Sent Stats report
- Receive Permanent email failures.