Skip to content

Commit 6c0b159

Browse files
authored
Merge pull request #2684 from strongloop/fix-glob-user
Apply g.f to literal strings
2 parents 987f29e + 0f5136d commit 6c0b159

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

common/models/user.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -443,26 +443,20 @@ module.exports = function(User) {
443443
function sendEmail(user) {
444444
options.verifyHref += '&token=' + user.verificationToken;
445445

446-
options.text = options.text || 'Please verify your email by opening ' +
447-
'this link in a web browser:\n\t{href}';
446+
options.text = options.text || g.f('Please verify your email by opening ' +
447+
'this link in a web browser:\n\t%s', options.verifyHref);
448448

449449
options.text = options.text.replace(/\{href\}/g, options.verifyHref);
450450

451-
options.text = g.f(options.text);
452-
453451
options.to = options.to || user.email;
454452

455-
options.subject = options.subject || 'Thanks for Registering';
456-
457-
options.subject = g.f(options.subject);
453+
options.subject = options.subject || g.f('Thanks for Registering');
458454

459455
options.headers = options.headers || {};
460456

461457
var template = loopback.template(options.template);
462458
options.html = template(options);
463459

464-
options.html = g.f(options.html);
465-
466460
Email.send(options, function(err, email) {
467461
if (err) {
468462
fn(err);

0 commit comments

Comments
 (0)