class ActionMailbox::Ingresses::Mailgun::InboundEmailsController

def key

def key
  if Rails.application.credentials.dig(:action_mailbox, :mailgun_api_key)
    ActiveSupport::Deprecation.warn(<<-MSG.squish)
      Rails.application.credentials.action_mailbox.api_key is deprecated and will be ignored in Rails 6.2.
      Use Rails.application.credentials.action_mailbox.signing_key instead.
    MSG
    Rails.application.credentials.dig(:action_mailbox, :mailgun_api_key)
  elsif ENV["MAILGUN_INGRESS_API_KEY"]
    ActiveSupport::Deprecation.warn(<<-MSG.squish)
      The MAILGUN_INGRESS_API_KEY environment variable is deprecated and will be ignored in Rails 6.2.
      Use MAILGUN_INGRESS_SIGNING_KEY instead.
    MSG
    ENV["MAILGUN_INGRESS_API_KEY"]
  else
    Rails.application.credentials.dig(:action_mailbox, :mailgun_signing_key) || ENV["MAILGUN_INGRESS_SIGNING_KEY"]
  end
end