Class: InboundParseWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/inbound_parse_worker.rb

Instance Method Summary collapse

Instance Method Details

#performObject

Inbound emails can have 5 statuses: failed, delivered, processing, pending, bounced
Tutorial on how to debug https://world.hey.com/robzolkos/debugging-production-actionmailbox-issues-in-development-f5886579
inbound_email.pending! to switch the status back to pending from failed
inbound_email.route to force the email to route to its mailer



11
12
13
14
15
16
17
18
# File 'app/workers/inbound_parse_worker.rb', line 11

def perform

  failed_emails = ActionMailbox::InboundEmail.where(status: 'failed')
  return unless failed_emails.present?

  InternalMailer.inbound_email_processing_issues(failed_emails).deliver

end