Skip to content

Commit

Permalink
Save email to MailDeliveryFailure
Browse files Browse the repository at this point in the history
  • Loading branch information
syed87 committed Aug 15, 2024
1 parent 767cfa0 commit fcd2f85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ class ApplicationMailer < Mail::Notify::Mailer
#
# @see https://github.com/rails/rails/issues/39018
if respond_to?(:headers)
binding.break
email = Email.find(headers['email-log-id'].to_s)
email.update!(delivery_status: 'notify_error')
recipient_email = headers['To'].value
MailDeliveryFailure.create!(
recipient_email: recipient_email
)
end

raise
Expand Down

0 comments on commit fcd2f85

Please sign in to comment.