FIX: don't send digests to users with no primary email

It might happen that some User records have no associated primary emails.
In which case we don't ever want to send them a digest.

Also added a new "user_email_no_email" skipped email log to ensure these cases
are properly handled and surfaced.
This commit is contained in:
Régis Hanol
2020-05-27 17:09:40 +02:00
parent 2152e70e0d
commit 2a4db15544
5 changed files with 20 additions and 7 deletions

View File

@@ -37,7 +37,8 @@ class SkippedEmailLog < ActiveRecord::Base
sender_post_deleted: 20,
sender_message_to_invalid: 21,
user_email_access_denied: 22,
sender_topic_deleted: 23
sender_topic_deleted: 23,
user_email_no_email: 24,
# you need to add the reason in server.en.yml below the "skipped_email_log" key
# when you add a new enum value
)