From e212c731dd0348434586de8fdbdad383d3072fae Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sat, 4 Jan 2020 13:33:35 -0800 Subject: Email refactoring Tons of refactoring of email. This no longer uses Sendgrid templates and now uses source-controlled handlebars files in the `views/emails/` directory. This means that email messages are now source-controlled and vastly reduces the sendgrid setup process. This also adds a new file, `domain-example.js`, in the config directory, which stores things like the site name, base URL, port, etc. This should be renamed to `domain.js`, in keeping with the other configuration files. --- app.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app.js') diff --git a/app.js b/app.js index a8d2889..42626ff 100755 --- a/app.js +++ b/app.js @@ -19,6 +19,7 @@ const app = express(); hbsInstance = hbs.create({ defaultLayout: 'main', partialsDir: ['views/partials/'], + layoutsDir: 'views/layouts/', helpers: { plural: function(number, text) { var singular = number === 1; @@ -39,6 +40,7 @@ hbsInstance = hbs.create({ }); app.engine('handlebars', hbsInstance.engine); app.set('view engine', 'handlebars'); +app.set('hbsInstance', hbsInstance); // Static files // -- cgit v1.2.3