Browse Source

Add the datetime unsubscribed on.

master
Zed A. Shaw 1 week ago
parent
commit
71b9716b9d
  1. 2
      api/email.js

2
api/email.js

@ -12,7 +12,7 @@ const unsubscribe_user = async (unsubkey) => {
// already unsubscribed so just ignore them
} else if(user && !user.unsubscribe) {
// not unsubscribed so change it
const res = await User.update({id: user.id}, {unsubscribe: true});
const res = await User.update({id: user.id}, {unsubscribe: true, unsubscribed_on: Date.now() });
assert(res !== undefined, `failed to update unsubscribe for user ${user.id}`);
} else {
assert(false, `User unsubscribe key does not exist ${unsubkey}`);

Loading…
Cancel
Save