Skip to content

Commit

Permalink
Update subscription date on public unsubscribe. Closes #915.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 1, 2022
1 parent d8e3e25 commit 879bff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ sub AS (
UPDATE subscribers SET status = (CASE WHEN $3 IS TRUE THEN 'blocklisted' ELSE status END)
WHERE uuid = $2 RETURNING id
)
UPDATE subscriber_lists SET status = 'unsubscribed' WHERE
UPDATE subscriber_lists SET status = 'unsubscribed', updated_at=NOW() WHERE
subscriber_id = (SELECT id FROM sub) AND status != 'unsubscribed' AND
-- If $3 is false, unsubscribe from the campaign's lists, otherwise all lists.
CASE WHEN $3 IS FALSE THEN list_id = ANY(SELECT list_id FROM lists) ELSE list_id != 0 END;
Expand Down

0 comments on commit 879bff8

Please sign in to comment.