Badge for enabling mailing list mode

This badge detects whether a user has enabled mailing list mode:

SELECT u.id user_id, current_timestamp granted_at
FROM users u
WHERE mailing_list_mode = true
AND (:backfill OR u.id IN (:user_ids))

It should trigger when a user is created or edited.

そのクエリは動作していません。メーリングリストモードのユーザーを取得するための更新されたバージョンを以下に示します。

SELECT user_id, current_timestamp granted_at
FROM user_options
WHERE mailing_list_mode = true
AND (:backfill OR user_id IN (:user_ids))