sorich87 / express-mail Goto Github PK
View Code? Open in Web Editor NEWEasy email delivery from Express apps
Easy email delivery from Express apps
Hi,
Can we supply html instead of template as 1st parameter to app.mailer.send(template, locals, callback)?
Hello, does express-mail support Express 4 ?
I'm running into this error when I run the example:
/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:52
app.send('mail', mailOptions, function (error, response) {
^
TypeError: Object function (req, res, next) {
app.handle(req, res, next);
} has no method 'send'
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:52:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/server.js:3:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
[gulp] [nodemon] app crashed - waiting for file changes before starting...
[BS] Reloading Browsers...
[gulp] [nodemon] restarting due to changes...
[gulp] [nodemon] starting node server.js
/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:25
expressMail.extend(app, {
^
TypeError: Object function extend(options) {
var defaults = {
generateTextFromHTML: true
};
var stub = nodemailer.createTransport('STUB', options.config);
var transport = nodemailer.createTransport(options.transport, options.config);
defaults = merge(defaults, options.defaults);
/**
Close current transport and replace it with a new one.
*
@param {Object} options
@param {Function} cb
@api private
*/
function reload(options, cb) {
transport.close(function (err) {
if (err) {
if (cb) {
cb(err);
}
return;
}
defaults = merge({}, options.defaults);
transport = nodemailer.createTransport(options.transport, options.config);
if (cb) {
cb();
}
});
}
return function (req, res, next) {
var app = req.app;
var ext = app.get('view engine');
var root = app.get('views');
if (ext[0] !== '.') {
ext = '.' + ext;
}
app.mail = {
reload: reload,
send: sendFactory(transport, app.render.bind(app), root, ext, defaults),
stub: sendFactory(stub, app.render.bind(app), root, ext, defaults)
};
res.mail = {
reload: reload,
send: sendFactory(transport, res.render.bind(res), root, ext, defaults),
stub: sendFactory(stub, res.render.bind(res), root, ext, defaults)
};
next();
};
} has no method 'extend'
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/express/app.js:25:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/antoniobrandao/WEBROOT/ABWA/server.js:3:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
[gulp] [nodemon] app crashed - waiting for file changes before starting...
[BS] Reloading Browsers...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.