# Feature: Transactional email (platform)

## Purpose

Shared HTML/text mail chrome for human-facing emails: light body, navy/cyan buttons, and an ALFRED sign-off (logo plus expanded name).

## Boundaries

- **Owns:** Published Laravel mail views under `laravel/resources/views/vendor/mail/`, notification markdown view `laravel/resources/views/vendor/notifications/email.blade.php`, ALFRED footer logo at `laravel/public/images/emails/alfred-service-diary.png`. Header mark reuses the brand PNG at `laravel/public/images/brand/servdiary-icon.png` (see [Branding](branding.md)).
- **Does not own:** Domain-specific mail copy (invoice/quote body, team invitation wording, SMS templates)
- **Depends on (platform only):** Laravel Mail / Markdown; `APP_URL` for the logo `asset()` URL
- **Depends on (other domains):** none
- **Removable?** No — shared outbound email shell

## Header and sign-off

Header: ServDiary house/calendar icon (`images/brand/servdiary-icon.png`) plus the word **ServDiary**. This does not use Laravel’s notification logo and does not depend on `APP_NAME`.

Every markdown mail (`<x-mail::message>` / `mail::message`) ends with:

- Regards line: `A.L.F.R.E.D`
- Footer: ALFRED logo (`alt="A.L.F.R.E.D Service Diary"`) on a black panel
- Expansion: **Automated Logistics, Facilities, Repair & Environmental Director**

Plain-text alternatives include the name and expansion without the image.

## Covered mail

| Mail | How it picks up the theme |
|------|---------------------------|
| Jetstream team invitation | `emails.team-invitation` already uses `mail::message` |
| Fortify password reset | `notifications::email` uses `mail::message` |
| Invoice / quote document mail | Markdown `emails.invoices.document` |
| Welcome (public signup) | Markdown `emails.welcome` via `WelcomeMail` |
| Generated password (owner-confirmed send) | Markdown `emails.generated-password` via `GeneratedPasswordMail` |

## Tests

- Path: `laravel/tests/Feature/TransactionalEmailTemplateTest.php`
- Cover: invoice HTML branding, team invitation HTML branding, welcome + generated-password HTML branding (ServDiary header mark, no Laravel logo)
- Welcome send: `RegistrationTest` (exactly one `WelcomeMail` on signup). Copy mentions completing checkout for the 30-day trial.
- Credentials send: `CreateTeamMemberWithPasswordTest` (create sends nothing; owner must POST `team-members.credentials-email`)

## Notes for agents

- New human-facing mailables should use markdown + `<x-mail::message>` so they inherit this theme.
- Public signup fires `Illuminate\Auth\Events\Registered`; `App\Listeners\SendWelcomeEmail` sends `WelcomeMail` (auto-discovered). Do not also `Event::listen` that class or signup sends twice.
- The logo is served from `APP_URL`; production must use a public application URL for images to load in inboxes.
