Module: Mailkube::Rails

Defined in:
lib/mailkube/rails.rb,
lib/mailkube/rails/config.rb,
lib/mailkube/rails/errors.rb,
lib/mailkube/rails/payload.rb,
lib/mailkube/rails/railtie.rb,
lib/mailkube/rails/version.rb,
lib/mailkube/rails/delivery_method.rb,
lib/mailkube/rails/webhooks_controller.rb,
sig/mailkube/rails.rbs

Overview

ActionMailer delivery for mailkube, and an inbound webhook endpoint.

This module is a thin adapter. The wire format, authentication, retry policy, error taxonomy and webhook signature scheme all belong to the mailkube gem; nothing here re-implements any of them. See .rules/INTEGRATION_CONTRACT.md.

Requiring this file loads the delivery half only. WebhooksController is deliberately NOT required here: it subclasses ActionController::Base, and a worker process that only sends mail should not be made to load ActionController. Applications that receive webhooks reach it through the route they write, which autoloads it.

The naming trap

Inside this namespace the bare constant Rails resolves to this module, not to the framework. Every reference to the framework is therefore written ::Rails, fully qualified. Ruby resolves the wrong one silently and the result is a NoMethodError a long way from the cause, so this is the most likely first bug in any change here. spec/naming_spec.rb pins it.

Defined Under Namespace

Modules: Config, Payload Classes: DeliveryError, DeliveryMethod, Railtie, WebhooksController

Constant Summary collapse

VERSION =

This gem's version, and the only place it is written.

The gemspec reads it, and so does the User-Agent suffix, so a release cannot report one version to RubyGems and a different one to the API. It stays at 0.0.0 in the repository: semantic-release rewrites this line in the release runner and never commits it back. See .rules/RELEASE.md.

Returns:

  • (String)
"1.0.0"