if Rails.env.staging? || Rails.env.production?
  Aws::Rails.add_action_mailer_delivery_method(
    :aws_sdk,
    credentials: Aws::Credentials.new(
      Rails.application.credentials.dig(Rails.env.to_sym, :aws_access_key_id),
      Rails.application.credentials.dig(Rails.env.to_sym, :aws_secret_access_key)
    ),
    region: "eu-central-1"
  )
end
