From 77364a93f04a8f539408cca13b71ef8290f8667d Mon Sep 17 00:00:00 2001 From: Setogit Date: Sat, 27 Aug 2016 22:42:21 -0700 Subject: [PATCH] Apply g.f to literal strings [back-port of #2684] --- common/models/user.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index 210df6db..89017c45 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -436,25 +436,20 @@ module.exports = function(User) { function sendEmail(user) { options.verifyHref += '&token=' + user.verificationToken; - options.text = options.text || 'Please verify your email by opening this link in a web browser:\n\t{href}'; + options.text = options.text || g.f('Please verify your email by opening ' + + 'this link in a web browser:\n\t%s', options.verifyHref); options.text = options.text.replace(/\{href\}/g, options.verifyHref); - options.text = g.f(options.text); - options.to = options.to || user.email; - options.subject = options.subject || 'Thanks for Registering'; - - options.subject = g.f(options.subject); + options.subject = options.subject || g.f('Thanks for Registering'); options.headers = options.headers || {}; var template = loopback.template(options.template); options.html = template(options); - options.html = g.f(options.html); - Email.send(options, function(err, email) { if (err) { fn(err);