Skip to content

✨ Mailer: central brand values via config.mailer.brand #4130

Description

@PierreBrisorgueil

What

  • Add mailer.brand with these fields:
    • name, falling back to app.title
    • url, falling back to app.url || getBaseUrl()
    • contact, falling back to app.contact
    • logoUrl, primaryColor, textColor, mutedColor, fontFamily, signature, footerText
    • links as a { label: url } object (arrays replace on deep merge)
  • Export a getBrand() getter as the single source of the resolved values.
  • render injects brand, plus the legacy appName (= brand.name) and appContact (= brand.contact). Brand wins over caller-passed values for those two keys only.

Acceptance criteria

  • With no brand config, the output is identical to today's.
  • Setting mailer.brand.name changes {{appName}} in every mail, including templates that exist only in a downstream.
  • DEVKIT_NODE_mailer_brand_<field> env vars set brand values.
  • A partial brand override keeps the other defaults.
  • All brand values render escaped.

Tests

  • Fallbacks with an empty brand.
  • An override from a mocked config shaped like a downstream override.
  • Brand winning over a caller-passed appName.
  • A deepMerge check with a partial brand override.

Depends on: resolver (render).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions