Boot-time validator for TRACK-03 configuration (D-32).
When ANY loaded mailable module has tracking: [opens: true] or
tracking: [clicks: true] in its @mailglass_opts, the
config :mailglass, :tracking, host: key is REQUIRED. Boot fails
with %Mailglass.ConfigError{type: :tracking_host_missing} on
omission.
Adopter usage (v0.1)
Call from your Application.start/2 callback after
Mailglass.Config.validate_at_boot!/0:
def start(_type, _args) do
Mailglass.Config.validate_at_boot!()
Mailglass.Tracking.ConfigValidator.validate_at_boot!()
# ...
endv0.5 will auto-wire this into Mailglass.Config.validate_at_boot!/0.
Detection algorithm
Walks :code.all_loaded/0 checking for modules that export both
__mailglass_mailable__/0 (discovery marker) and __mailglass_opts__/0
(compile-time opts reflection). Any module with opens: true or
clicks: true in its :tracking opts triggers the host check.
Summary
Functions
Raises %Mailglass.ConfigError{type: :tracking_host_missing} if any
loaded Mailglass.Mailable module has tracking enabled AND
:tracking, :host is unset or empty.
Functions
@spec validate_at_boot!() :: :ok
Raises %Mailglass.ConfigError{type: :tracking_host_missing} if any
loaded Mailglass.Mailable module has tracking enabled AND
:tracking, :host is unset or empty.
Returns :ok otherwise.