Unsub from all FCC emails regardless of unsub link

This commit is contained in:
Aniruddh Agarwal
2016-04-15 21:38:03 +08:00
parent 049679fdbf
commit dc24c42f54

View File

@ -177,7 +177,11 @@ module.exports = function(app) {
});
return res.redirect('/map');
}
return user.updateAttribute('sendMonthlyEmail', false, (err) => {
return user.updateAttributes({
'sendMonthlyEmail': false,
'sendQuincyEmail': false,
'sendNotificationEmail': false
}, (err) => {
if (err) { return next(err); }
req.flash('info', {
msg: 'We\'ve successfully updated your Email preferences.'
@ -219,7 +223,11 @@ module.exports = function(app) {
});
return res.redirect('/map');
}
return user.updateAttribute('sendQuincyEmail', false, (err) => {
return user.updateAttributes({
'sendQuincyEmail': false,
'sendMonthlyEmail': false,
'sendNotificationEmail': false
}, (err) => {
if (err) { return next(err); }
req.flash('info', {
msg: 'We\'ve successfully updated your Email preferences.'