More or less all the functionality for selectable unsubscription process. Not tested yet!

Sending emails moved completely to controller. It felt strange to have some emails sent from the controller and some of them from the model.
Confirmations refactored to an independent model that can be potentially used also for other actions that need an email confirmation.
This commit is contained in:
Tomas Bures 2017-05-03 15:46:49 -04:00
parent 32e2e61789
commit bd4961366f
13 changed files with 672 additions and 488 deletions

View file

@ -1074,7 +1074,7 @@ module.exports.updateMessage = (message, status, updateSubscription, callback) =
}
if (updateSubscription) {
subscriptions.changeStatus(message.subscription, message.list, statusCode === 2 ? message.campaign : false, statusCode, callback);
subscriptions.changeStatus(message.list, message.subscription, statusCode === 2 ? message.campaign : false, statusCode, callback);
} else {
return callback(null, true);
}