Pass the full options object to the email send method in user verification process.

This commit is contained in:
Alexandru Savin 2015-05-06 15:52:07 +02:00
parent ce26141d85
commit f70c209526
1 changed files with 9 additions and 8 deletions

View File

@ -391,15 +391,16 @@ module.exports = function(User) {
options.text = options.text.replace('{href}', options.verifyHref);
options.to = options.to || user.email;
options.subject = options.subject || 'Thanks for Registering';
options.headers = options.headers || {};
var template = loopback.template(options.template);
Email.send({
to: options.to || user.email,
from: options.from,
subject: options.subject || 'Thanks for Registering',
text: options.text,
html: template(options),
headers: options.headers || {}
}, function(err, email) {
options.html = template(options);
Email.send(options, function(err, email) {
if (err) {
fn(err);
} else {