class InboundEmail

Ruby on Rails 6.0.6

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

The InboundEmail is an Active Record that keeps a reference to the raw email stored in Active Storage and tracks the status of processing. By default, incoming emails will go through the following lifecycle:

  • Pending: Just received by one of the ingress controllers and scheduled for routing.

  • Processing: During active processing, while a specific mailbox is running its #process method.

  • Delivered: Successfully processed by the specific mailbox.

  • Failed: An exception was raised during the specific mailbox’s execution of the #process method.

  • Bounced: Rejected processing by the specific mailbox and bounced to sender.

Once the InboundEmail has reached the status of being either delivered, failed, or bounced, it’ll count as having been #processed?. Once processed, the InboundEmail will be scheduled for automatic incineration at a later point.

When working with an InboundEmail, you’ll usually interact with the parsed version of the source, which is available as a Mail object from #mail. But you can also access the raw source directly using the #source method.

Examples:

inbound_email.mail.from # => 'david@loudthinking.com'
inbound_email.source # Returns the full rfc822 source of the email as text

Inherits from

ActiveRecord::Base

Namespace

Modules

Methods (defined here)

Methods (inherited)

From ActiveModel::Conversion (4)
From ActiveModel::Naming (7)
From ActiveRecord::Aggregations::ClassMethods (1)
From ActiveRecord::AttributeMethods (9)
From ActiveRecord::AutosaveAssociation (6)
From ActiveRecord::ConnectionHandling (13)
From ActiveRecord::Core (31)
From ActiveRecord::Enum (1)
From ActiveRecord::Inheritance (1)
From ActiveRecord::Integration (7)
From ActiveRecord::Locking::Pessimistic (2)
From ActiveRecord::ModelSchema (14)
From ActiveRecord::NoTouching (1)
From ActiveRecord::Persistence (25)
From ActiveRecord::QueryCache::ClassMethods (2)
From ActiveRecord::Querying (2)
From ActiveRecord::Validations (4)
From ActiveSupport::Benchmarkable (1)
From ActiveSupport::DescendantsTracker (7)
From Object (17)
From ActiveModel::AttributeAssignment (2)
From ActiveModel::AttributeMethods (4)
From ActiveModel::Translation (3)
From ActiveModel::Validations (6)
From ActiveRecord::AttributeMethods::BeforeTypeCast (2)
From ActiveRecord::AttributeMethods::Dirty (13)
From ActiveRecord::AttributeMethods::PrimaryKey (7)
From ActiveRecord::AttributeMethods::Query (1)
From ActiveRecord::AttributeMethods::Read (2)
From ActiveRecord::AttributeMethods::Write (1)
From ActiveRecord::TestFixtures (4)
From ActiveSupport::Autoload (6)
From ActiveSupport::Concern (2)
From ActiveModel::Callbacks (1)
From ActiveModel::Dirty (9)
From ActiveModel::Validations::HelperMethods (10)
From ActiveSupport::Callbacks (1)

Type at least 2 characters to search.

↑↓ navigate · open · esc close