Release candidate of the selectable unsubscription
Implemented the resubscription process - i.e. pre-filling in the form when the subscription link is clicked in the unsubscription notice.
This commit is contained in:
parent
bd4961366f
commit
a6d25e668b
12 changed files with 238 additions and 194 deletions
|
@ -1054,13 +1054,13 @@ module.exports.updateMessage = (message, status, updateSubscription, callback) =
|
|||
|
||||
let statusCode;
|
||||
if (status === 'unsubscribed') {
|
||||
statusCode = 2;
|
||||
}
|
||||
if (status === 'bounced') {
|
||||
statusCode = 3;
|
||||
}
|
||||
if (status === 'complained') {
|
||||
statusCode = 4;
|
||||
statusCode = subscriptions.Status.UNSUBSCRIBED;
|
||||
} else if (status === 'bounced') {
|
||||
statusCode = subscriptions.Status.BOUNCED;
|
||||
} else if (status === 'complained') {
|
||||
statusCode = subscriptions.Status.COMPLAINED;
|
||||
} else {
|
||||
return callback(new Error(_('Unrecognized message status')));
|
||||
}
|
||||
|
||||
let query = 'UPDATE `campaigns` SET `' + status + '`=`' + status + '`+1 WHERE id=? LIMIT 1';
|
||||
|
@ -1074,7 +1074,7 @@ module.exports.updateMessage = (message, status, updateSubscription, callback) =
|
|||
}
|
||||
|
||||
if (updateSubscription) {
|
||||
subscriptions.changeStatus(message.list, message.subscription, statusCode === 2 ? message.campaign : false, statusCode, callback);
|
||||
subscriptions.changeStatus(message.list, message.subscription, statusCode === subscriptions.Status.UNSUBSCRIBED ? message.campaign : false, statusCode, callback);
|
||||
} else {
|
||||
return callback(null, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue