emails: fix sending emails to invalid addresses.
Fix mailers to not attempt deliveries to invalid or nonexistent email addresses. This usually happened when someone changed their email, and we tried to send a confirmation email to a nonexistent address.
This commit is contained in:
@@ -141,7 +141,7 @@ class Dmail < ApplicationRecord
|
||||
end
|
||||
|
||||
def send_email
|
||||
if is_recipient? && !is_deleted? && to.receive_email_notifications? && to.can_receive_email?
|
||||
if is_recipient? && !is_deleted? && to.receive_email_notifications?
|
||||
UserMailer.dmail_notice(self).deliver_later
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user