Apply g.f to literal strings

Backport #2684
This commit is contained in:
Candy 2016-08-29 10:10:39 -04:00
parent 5f74e74ea0
commit 069d3e8f2f
1 changed files with 3 additions and 8 deletions

View File

@ -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);