Installer template helpers for owned files and managed shared-file patches.
Summary
Functions
Returns the starter layout template content.
Returns the default mailable stub source.
Marker line for the end of the managed endpoint webhook-parser block.
Marker line for the start of the managed endpoint webhook-parser block.
Returns the verbatim Plug.Parsers body_reader config block inserted into
endpoint.ex.
Returns the generated mail context module source.
Wraps a managed block body with explicit start/end markers.
Returns the generated Oban worker stub source.
Anchor substring used to insert router snippets.
Returns the snippet inserted into router.ex for the Mailglass admin surface.
Marker line for the end of the managed runtime config block.
Marker line for the start of the managed runtime config block.
Returns the managed block body inserted into runtime.exs.
Returns the snippet inserted into router.ex for the Mailglass webhook surface.
Functions
@spec default_layout() :: String.t()
Returns the starter layout template content.
Returns the default mailable stub source.
@spec endpoint_webhook_block_end() :: String.t()
Marker line for the end of the managed endpoint webhook-parser block.
@spec endpoint_webhook_block_start() :: String.t()
Marker line for the start of the managed endpoint webhook-parser block.
@spec endpoint_webhook_parser_body() :: String.t()
Returns the verbatim Plug.Parsers body_reader config block inserted into
endpoint.ex.
Returns the generated mail context module source.
Wraps a managed block body with explicit start/end markers.
Returns the generated Oban worker stub source.
@spec router_anchor() :: String.t()
Anchor substring used to insert router snippets.
Phoenix 1.5+ routers conventionally have use MyAppWeb, :router as the
first non-defmodule line. The macro expands to use Phoenix.Router at
compile time, but the source file does NOT contain that literal — so an
earlier version of this anchor ("use Phoenix.Router") silently failed
to match real adopters' routers and fell through to conflict-sidecar
behavior. Match , :router instead, which appears in use FooWeb, :router and is rare elsewhere in router source.
Adopters still on Phoenix < 1.5 with the literal use Phoenix.Router
call must run mix mailglass.install --force (the anchor-not-found +
force fallback) and manually move the appended snippets inside the
module block. v0.1+ targets Phoenix 1.7+ per STACK.md, so this case is
not the default-supported path.
Returns the snippet inserted into router.ex for the Mailglass admin surface.
@spec runtime_block_end() :: String.t()
Marker line for the end of the managed runtime config block.
@spec runtime_block_start() :: String.t()
Marker line for the start of the managed runtime config block.
@spec runtime_config_body() :: String.t()
Returns the managed block body inserted into runtime.exs.
Sets Swoosh's :api_client to Swoosh.ApiClient.Finch because Finch
ships with mix phx.new (it's the default HTTP client for the host
Phoenix app). Swoosh's own default at v1.25 is
Swoosh.ApiClient.Hackney which would require adopters to add
{:hackney, "~> 1.18"} and start a hackney supervisor manually. With
Finch, no extra deps or boot wiring is needed — adopters can mix mailglass.install and immediately mix phx.server without surprise.
Returns the snippet inserted into router.ex for the Mailglass webhook surface.