Merge pull request #1368 from alexandrusavin/master
Pass the full options object to the email send method in user verification process
This commit is contained in:
commit
694ab814f9
|
@ -391,15 +391,16 @@ module.exports = function(User) {
|
||||||
|
|
||||||
options.text = options.text.replace('{href}', options.verifyHref);
|
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);
|
var template = loopback.template(options.template);
|
||||||
Email.send({
|
options.html = template(options);
|
||||||
to: options.to || user.email,
|
|
||||||
from: options.from,
|
Email.send(options, function(err, email) {
|
||||||
subject: options.subject || 'Thanks for Registering',
|
|
||||||
text: options.text,
|
|
||||||
html: template(options),
|
|
||||||
headers: options.headers || {}
|
|
||||||
}, function(err, email) {
|
|
||||||
if (err) {
|
if (err) {
|
||||||
fn(err);
|
fn(err);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue