Browse Source

Fixed callback not being called upon error

Brendan Abolivier 8 years ago
parent
commit
c474e0fc69
Signed by: Brendan Abolivier <contact@brendanabolivier.com> GPG key ID: 8EF1500759F70623
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      server.js

+ 1
- 1
server.js View File

147
             params.to = recipient;
147
             params.to = recipient;
148
             // Send the email
148
             // Send the email
149
             transporter.sendMail(params, (err, infos) => {
149
             transporter.sendMail(params, (err, infos) => {
150
+                sent();
150
                 if(err) {
151
                 if(err) {
151
                     return update(err, recipient);
152
                     return update(err, recipient);
152
                 }
153
                 }
153
                 update(null, infos);
154
                 update(null, infos);
154
                 // Promise callback
155
                 // Promise callback
155
-                sent();
156
             });
156
             });
157
         });
157
         });
158
     });
158
     });