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 false, matching mailglass's own
config/config.exs and mailglass_admin/config/config.exs. Mailglass
does not pin a specific HTTP client at the package level: API-based
Swoosh adapters (Postmark, SendGrid, Mailgun, SES, Resend) require an
HTTP client, but the choice belongs to the adopter. With
:api_client set to false, Swoosh.ApiClient.init/0 no-ops cleanly
so a fresh mix phx.new --no-mailer host boots without needing
:finch, :hackney, or :req in deps. Adopters using an API-based
Swoosh adapter must opt in explicitly — the commented examples below
show how.
Returns the snippet inserted into router.ex for the Mailglass webhook surface.