From f70c209526950e5e2c058e7d62414e7504547c6b Mon Sep 17 00:00:00 2001
From: Alexandru Savin <alexandrusavin@gmail.com>
Date: Wed, 6 May 2015 15:52:07 +0200
Subject: [PATCH] Pass the full options object to the email send method in user
 verification process.

---
 common/models/user.js | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/common/models/user.js b/common/models/user.js
index 06f09500..2677f0d9 100644
--- a/common/models/user.js
+++ b/common/models/user.js
@@ -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 {