Class: ActionMailbox::IncinerationJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/action_mailbox/incineration_job.rb

Overview

You can configure when this IncinerationJob will be run as a time-after-processing using the config.action_mailbox.incinerate_after or ActionMailbox.incinerate_after setting.

Since this incineration is set for the future, it’ll automatically ignore any InboundEmails that have already been deleted and discard itself if so.

You can disable incinerating processed emails by setting config.action_mailbox.incinerate or ActionMailbox.incinerate to false.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.schedule(inbound_email) ⇒ Object



17
18
19
# File 'app/jobs/action_mailbox/incineration_job.rb', line 17

def self.schedule(inbound_email)
  set(wait: ActionMailbox.incinerate_after).perform_later(inbound_email)
end

Instance Method Details

#perform(inbound_email) ⇒ Object



21
22
23
# File 'app/jobs/action_mailbox/incineration_job.rb', line 21

def perform(inbound_email)
  inbound_email.incinerate
end