Skip to content

Commit

Permalink
add class which extends the behaviour of MailDeliveryJob by recording…
Browse files Browse the repository at this point in the history
… information in the MailDeliveryFailure table
  • Loading branch information
syed87 committed Jul 17, 2024
1 parent 2ca4ddd commit eff45f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/jobs/log_mail_delivery_failure_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class LogMailDeliveryFailureJob < ActionMailer::MailDeliveryJob
def perform(*args)
super
rescue => e

record_failure(*args)
end

private

def record_failure(*args)
MailDeliveryFailure.create(
email_address:
mailer_class:
mailer_action_method:
)
end
end

0 comments on commit eff45f9

Please sign in to comment.