O'Reilly logo
  • Patrick S thinks this is interesting:

The app.render() method is invoked either with a view name and a callback or with a view name, data, and a callback. For example, the system might have an e-mail template for a “Thank you for signing up” message and another for “Reset your password”:

var sendgrid  = require('sendgrid')(api_user, api_key);

var sendThankYouEmail = function(userEmail) {
  app.render('emails/thank-you', function(err, html){


Cover of Pro Express.js


app.render example