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:
Tomas Bures 2017-05-04 17:42:46 -04:00
parent bd4961366f
commit a6d25e668b
12 changed files with 238 additions and 194 deletions

View file

@ -16,14 +16,14 @@ module.exports.addConfirmation = (listId, action, ip, data, callback) => {
}
let query = 'INSERT INTO confirmations (cid, list, action, ip, data) VALUES (?,?,?,?,?)';
connection.query(query, [cid, list, action, ip, JSON.stringify(data || {})], (err, result) => {
connection.query(query, [cid, listId, action, ip, JSON.stringify(data || {})], (err, result) => {
connection.release();
if (err) {
return callback(err);
}
if (!result || !result.affectedRows) {
return callback(null, false);
return callback(new Error(_('Could not store confirmation data')));
}
return callback(null, cid);