nodemailer-mail-tracking
v0.7.0
Published
## Install
Downloads
368
Readme
Nodemailer Mail tracking
Install
npm install nodemailer-mail-tracking
yarn add nodemailer-mail-tracking
Usage
import { sendMail, expressApp } from "nodemailer-mail-tracking"
import { createTransport } from 'nodemailer';
import express from 'express';
const transporter = createTransport(/* ... */);
sendMail(mailTrackingOptions, transporter, sendMailOptions)
const app = express();
app.use('/mail-track', expressApp(mailTrackingOptions));
Options
const mailTrackOptions = {
baseUrl: 'http://localhost:3000/mail-track',
jwtSecret: 'secret',
getData: data => {
/*
Default data: { recipient: "[email protected]" }
Add any data if you want
*/
return { ...data, hello: 'world' };
},
onBlankImageView: data => {
/*
When email is opened
data is default data + your data
*/
},
onLinkClick: data => {
/*
When click on link in mail
data is default data + { link } + your data
*/
},
}