diff --git a/lib/server.js b/lib/server.js index 8db62ab..1a81390 100644 --- a/lib/server.js +++ b/lib/server.js @@ -359,9 +359,9 @@ WalletService.prototype._notify = function(type, data, opts, cb) { this.storage.storeNotification(walletId, notification, function() { self.messageBroker.send(notification); if (self.emailService) { - self.emailService.sendEmail(notification, function() { - if (cb) return cb(); - }); + self.emailService.sendEmail(notification, cb); + } else { + return cb(); } }); };