# `Mailglass.Installer.Templates`
[🔗](https://github.com/szTheory/mailglass/blob/v1.0.0/lib/mailglass/installer/templates.ex#L1)

Installer template helpers for owned files and managed shared-file patches.

# `default_layout`

```elixir
@spec default_layout() :: String.t()
```

Returns the starter layout template content.

# `default_mailable`

```elixir
@spec default_mailable(keyword()) :: String.t()
```

Returns the default mailable stub source.

# `endpoint_webhook_block_end`

```elixir
@spec endpoint_webhook_block_end() :: String.t()
```

Marker line for the end of the managed endpoint webhook-parser block.

# `endpoint_webhook_block_start`

```elixir
@spec endpoint_webhook_block_start() :: String.t()
```

Marker line for the start of the managed endpoint webhook-parser block.

# `endpoint_webhook_parser_body`

```elixir
@spec endpoint_webhook_parser_body() :: String.t()
```

Returns the verbatim Plug.Parsers body_reader config block inserted into
`endpoint.ex`.

# `mail_context_module`

```elixir
@spec mail_context_module(keyword()) :: String.t()
```

Returns the generated mail context module source.

# `managed_block`

```elixir
@spec managed_block(String.t(), String.t(), String.t()) :: String.t()
```

Wraps a managed block body with explicit start/end markers.

# `oban_worker_stub`

```elixir
@spec oban_worker_stub(keyword()) :: String.t()
```

Returns the generated Oban worker stub source.

# `router_anchor`

```elixir
@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.

# `router_mount_snippet`

```elixir
@spec router_mount_snippet(keyword()) :: String.t()
```

Returns the snippet inserted into `router.ex` for the Mailglass admin surface.

# `runtime_block_end`

```elixir
@spec runtime_block_end() :: String.t()
```

Marker line for the end of the managed runtime config block.

# `runtime_block_start`

```elixir
@spec runtime_block_start() :: String.t()
```

Marker line for the start of the managed runtime config block.

# `runtime_config_body`

```elixir
@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.

# `webhook_mount_snippet`

```elixir
@spec webhook_mount_snippet(keyword()) :: String.t()
```

Returns the snippet inserted into `router.ex` for the Mailglass webhook surface.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
