Apply g.f to literal strings

This commit is contained in:
Setogit 2016-08-27 22:42:21 -07:00
parent 358fdbf184
commit 0f5136d072
1 changed files with 3 additions and 9 deletions

View File

@ -443,26 +443,20 @@ module.exports = function(User) {
function sendEmail(user) { function sendEmail(user) {
options.verifyHref += '&token=' + user.verificationToken; options.verifyHref += '&token=' + user.verificationToken;
options.text = options.text || 'Please verify your email by opening ' + options.text = options.text || g.f('Please verify your email by opening ' +
'this link in a web browser:\n\t{href}'; 'this link in a web browser:\n\t%s', options.verifyHref);
options.text = options.text.replace(/\{href\}/g, options.verifyHref); options.text = options.text.replace(/\{href\}/g, options.verifyHref);
options.text = g.f(options.text);
options.to = options.to || user.email; options.to = options.to || user.email;
options.subject = options.subject || 'Thanks for Registering'; options.subject = options.subject || g.f('Thanks for Registering');
options.subject = g.f(options.subject);
options.headers = options.headers || {}; options.headers = options.headers || {};
var template = loopback.template(options.template); var template = loopback.template(options.template);
options.html = template(options); options.html = template(options);
options.html = g.f(options.html);
Email.send(options, function(err, email) { Email.send(options, function(err, email) {
if (err) { if (err) {
fn(err); fn(err);