UNPKG

nodebasecli

Version:

Cli to create modules for nodebase

26 lines (21 loc) 640 B
const fileData = (template, fileString) => `/** * @author "Abdul Quadir Dewaswala" * @license MIT * @version 1.0 */ import transporter from "${fileString}config/nodemailer.js "; export default (data) => { // Create an object to specify the options for the email. const mailOptions = { from: process.env.MAIL_FROM, to: 'user@example.com', subject: "subject", template: "${template}", context: { ...data } }; // Send the email using the transporter object. return transporter.sendMail(mailOptions); }` module.exports = fileData