Flowdock
Ruby on Rails latest stable (v5.2.3) - 0 notes - Superclass: BaseController
  • 1.0.0
  • 1.1.6
  • 1.2.6
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.2
  • 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)
  • What's this?

Class not available on this version

This class is only available on newer versions. The first available version of the class is shown here.

Ingests inbound emails from Mailgun. Requires the following parameters:

  • body-mime: The full RFC 822 message

  • timestamp: The current time according to Mailgun as the number of seconds passed since the UNIX epoch

  • token: A randomly-generated, 50-character string

  • signature: A hexadecimal HMAC-SHA256 of the timestamp concatenated with the token, generated using the Mailgun API key

Authenticates requests by validating their signatures.

Returns:

  • 204 No Content if an inbound email is successfully recorded and enqueued for routing to the appropriate mailbox

  • 401 Unauthorized if the request’s signature could not be validated, or if its timestamp is more than 2 minutes old

  • 404 Not Found if Action Mailbox is not configured to accept inbound emails from Mailgun

  • 422 Unprocessable Entity if the request is missing required parameters

  • 500 Server Error if the Mailgun API key is missing, or one of the Active Record database, the Active Storage service, or the Active Job backend is misconfigured or unavailable

Usage

  1. Give Action Mailbox your Mailgun API key so it can authenticate requests to the Mailgun ingress.

    Use rails credentials:edit to add your API key to your application’s encrypted credentials under action_mailbox.mailgun_api_key, where Action Mailbox will automatically find it:

    action_mailbox:
      mailgun_api_key: ...
    

    Alternatively, provide your API key in the MAILGUN_INGRESS_API_KEY environment variable.

  2. Tell Action Mailbox to accept emails from Mailgun:

    # config/environments/production.rb
    config.action_mailbox.ingress = :mailgun
    
  3. Configure Mailgun to forward inbound emails to /rails/action_mailbox/mailgun/inbound_emails/mime.

    If your application lived at example.com, you would specify the fully-qualified URL example.com/rails/action_mailbox/mailgun/inbound_emails/mime.

Show files where this class is defined (1 file)
Register or log in to add new notes.