Sha256: e4e72fd0ecb92dd8ddc64f54134379a7bcb472634222ffe6270465de446fa78b

Contents?: true

Size: 843 Bytes

Versions: 153

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

# A newly received +InboundEmail+ will not be routed synchronously as part of ingress controller's receival.
# Instead, the routing will be done asynchronously, using a +RoutingJob+, to ensure maximum parallel capacity.
#
# By default, all newly created +InboundEmail+ records that have the status of +pending+, which is the default,
# will be scheduled for automatic, deferred routing.
module ActionMailbox::InboundEmail::Routable
  extend ActiveSupport::Concern

  included do
    after_create_commit :route_later, if: :pending?
  end

  # Enqueue a +RoutingJob+ for this +InboundEmail+.
  def route_later
    ActionMailbox::RoutingJob.perform_later self
  end

  # Route this +InboundEmail+ using the routing rules declared on the +ApplicationMailbox+.
  def route
    ApplicationMailbox.route self
  end
end

Version data entries

153 entries across 148 versions & 12 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/actionmailbox-7.1.3.4/app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.0.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.2.2.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.1.5.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.0.8.7 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.0 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.2.2 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.1.5 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.0.rc2 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.2.1.2 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.1.4.2 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.0.8.6 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-6.1.7.10 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.0.rc1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-6.1.7.9 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.2.1.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.1.4.1 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-7.0.8.5 app/models/action_mailbox/inbound_email/routable.rb
actionmailbox-8.0.0.beta1 app/models/action_mailbox/inbound_email/routable.rb