LemonChannels. Adapters. Email. Config
(lemon_channels v0.1.0)
View Source
Configuration for the email adapter, from two sources.
config :lemon_channels, LemonChannels.Adapters.Email, ...— the channels-native surface, and the one to document for new deployments.- the canonical TOML
[gateway]config'semailblock, read throughLemonChannels.GatewayConfig.
The TOML source exists because email was configured there for as long as it
lived in lemon_gateway. Keeping it readable means an existing deployment's
relay credentials, sender address and webhook token survive the cutover
without anyone editing a config file. Application env wins on conflict, so a
channels-native setting is always the last word.
Lookups accept a key or a path ([:outbound, :relay]) and try the atom key
before its string form, since TOML-derived maps are not consistently keyed.
first_defined/2 walks a list of those in priority order — the nested
outbound/inbound sub-map before the flat alias — which is the resolution
order LemonGateway.Transports.Email.Outbound used and its characterization
tests pin.
Summary
Functions
Trims a binary and maps the empty result to nil; anything else to nil.
Reads key — an atom or a path of atoms — from a config map.
The first of keys that resolves to a non-nil value.
The merged configuration map.
The shared token the inbound webhook requires, or nil when none is set.
Functions
Trims a binary and maps the empty result to nil; anything else to nil.
Reads key — an atom or a path of atoms — from a config map.
Returns nil when any segment is missing or a non-final segment is not a map.
The first of keys that resolves to a non-nil value.
false counts as defined; only nil moves on to the next key.
@spec get() :: map()
The merged configuration map.
Never raises: an unreachable or malformed source contributes nothing rather
than failing the send, because the caller is usually mid-delivery and a
missing relay is already reported precisely by Outbound.smtp_options/1.
@spec webhook_token() :: binary() | nil
The shared token the inbound webhook requires, or nil when none is set.
nil means the endpoint rejects everything — see
LemonChannels.Adapters.Email.Webhook.