0
I am sending standardized emails using nodemailer with nodemailer-express-handlebars ,but whenever I am trying to send an email, I am receiving the
Error: A partials dir must be a string or config Object.
I don’t know what the problem is.
const path = require('path');
const nodemailer = require ('nodemailer');
const hbs = require('nodemailer-express-handlebars');
const { host, port, user, pass } = require('../config/mail.json');
const transport = nodemailer.createTransport({
host,
port,
auth: {user, pass },
});
transport.use('compile', hbs({
viewEngine: 'handlebars',
viewPath: path.resolve('./resources/mail/'),
extName: '.html',
}));
module.exports = transport;