From 9782cf0b9dd53a4d1fe29e5682a512220d994cc4 Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 22 Mar 2017 10:01:39 -0700 Subject: [PATCH] Mail SendSimple will not use app in the future but render from ejs. --- services/users.js | 3 +-- views/email/suspension.ejs | 2 +- views/email/suspension.txt.ejs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/services/users.js b/services/users.js index 2d6a94a79..261fbdfab 100644 --- a/services/users.js +++ b/services/users.js @@ -1,6 +1,5 @@ const bcrypt = require('bcrypt'); const jwt = require('jsonwebtoken'); -const ejs = require('ejs'); const Wordlist = require('./wordlist'); const errors = require('../errors'); @@ -474,7 +473,6 @@ module.exports = class UsersService { if (localProfile) { const options = { - app: ejs, // needed to render the templates. template: 'email/suspension', // needed to know which template to render! locals: { // specifies the template locals. body: message @@ -483,6 +481,7 @@ module.exports = class UsersService { to: localProfile.id // This only works if the user has registered via e-mail. // We may want a standard way to access a user's e-mail address in the future }; + return MailerService.sendSimple(options); } else { return Promise.reject(errors.ErrMissingEmail); diff --git a/views/email/suspension.ejs b/views/email/suspension.ejs index f19cc8043..b36560ec5 100644 --- a/views/email/suspension.ejs +++ b/views/email/suspension.ejs @@ -1 +1 @@ -<%= message %> +<%= body %> diff --git a/views/email/suspension.txt.ejs b/views/email/suspension.txt.ejs index f19cc8043..b36560ec5 100644 --- a/views/email/suspension.txt.ejs +++ b/views/email/suspension.txt.ejs @@ -1 +1 @@ -<%= message %> +<%= body %>