From dc24c42f5444b6c583770c2fdf407cb7c54b18f5 Mon Sep 17 00:00:00 2001 From: Aniruddh Agarwal Date: Fri, 15 Apr 2016 21:38:03 +0800 Subject: [PATCH] Unsub from all FCC emails regardless of unsub link --- server/boot/randomAPIs.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/boot/randomAPIs.js b/server/boot/randomAPIs.js index 3fd3f953bd..5d8a0e994a 100644 --- a/server/boot/randomAPIs.js +++ b/server/boot/randomAPIs.js @@ -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.'