- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
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