# `MailglassAdmin.Preview.Mount`
[🔗](https://github.com/szTheory/mailglass/blob/v1.0.0/lib/mailglass_admin/preview/mount.ex#L1)

`on_mount` hook the Router macro appends after any adopter-provided
`:on_mount` hooks. Reads the whitelisted session `"mailables"` value
populated by the router's preview session callback and runs discovery
before the preview LiveView finishes mounting.

## Order (Phoenix LiveView 1.1)

    preview session callback
      -> opts[:on_mount] hooks (adopter-provided, in order given)
      -> MailglassAdmin.Preview.Mount (this module)
      -> preview LiveView mount

Adopter hooks run BEFORE this one so they can short-circuit
(`{:halt, socket}`) without triggering discovery.

## v0.1 always-cont contract

This hook returns `{:cont, socket}` unconditionally. The dev preview
dashboard remains discovery-only, while the production operator
surface now uses the separate `MailglassAdmin.Operator.Mount`
authorization hook.

## Boundary classification

Submodule auto-classifies into the `MailglassAdmin` root boundary
declared in `lib/mailglass_admin.ex`; `classify_to:` is reserved for
mix tasks and protocol implementations and is not used here.

# `on_mount`

```elixir
@spec on_mount(
  atom(),
  map() | :not_mounted_at_router,
  map(),
  Phoenix.LiveView.Socket.t()
) ::
  {:cont, Phoenix.LiveView.Socket.t()}
```

Runs `Discovery.discover/1` using the session-supplied `mailables`
value and assigns `:mailables` on the socket.

Phoenix's `on_mount` machinery passes the module as-is (no stage atom),
so the first arg is `:default`.

---

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