Mailglass.Router (Mailglass v1.0.0)

Copy Markdown View Source

Router macro for mounting Mailglass unsubscribe endpoints in an adopter Phoenix router.

Usage

defmodule MyAppWeb.Router do
  use Phoenix.Router
  import Mailglass.Router

  scope "/" do
    pipe_through :browser
    mailglass_router_routes "/mailglass"
  end
end

Generates one GET and one POST route at the configured unsubscribe mount path, ending in /:token.

Options

  • :as - route helper prefix. Default: :mailglass_unsubscribe
  • :mount_path - explicit absolute mount path override. Intended for test-only compile scenarios; normal callers should rely on Mailglass.Config.compliance_mount_path/0.

Summary

Functions

Mounts the core unsubscribe GET and POST routes.

Functions

mailglass_router_routes(path, opts \\ [])

(since 0.2.0) (macro)

Mounts the core unsubscribe GET and POST routes.