mix mailglass.gen.mailbox (Mailglass v1.4.3)

Copy Markdown View Source

Scaffolds an inbound mailbox and wires it into your router.

Generates three things:

  1. A mailbox module implementing MailglassInbound.Mailbox with a default process/1 that returns the neutral :accept outcome.
  2. A route stub in the configured router, inserted idempotently via the same helper that backs mix mailglass.gen.inbound_route.
  3. An ExUnit test stub that use MailglassInbound.MailboxCase.

If the configured router module is not found, an actionable notice is emitted instead of auto-creating one — run mix mailglass.gen.inbound_router first.

Examples

mix mailglass.gen.mailbox MyApp.Inbound.Support
mix mailglass.gen.mailbox MyApp.Inbound.Support --recipient support@example.com
mix mailglass.gen.mailbox MyApp.Inbound.Support --router MyApp.InboundRouter

Positional arguments

  • mailbox - the mailbox module to create.

Options

  • --router - the router to add the route stub to. Defaults to <App>.InboundRouter.
  • --recipient - the recipient matcher for the route stub. Defaults to <underscored-mailbox-name>@example.com.

--dry-run is supported as the framework-provided global switch (it is not in this task's option schema); it previews the diff and writes nothing.