Files
crewli/api/app/Mail/RegistrationConfirmationMail.php
bert.hausmans ec4ba8733d feat(api): organisation email branding and shared mail layout
- Add email branding columns to organisations table (logo, color, reply-to, sender name, footer)
- Create MailBrandingService for resolving per-org branding with defaults
- Create CrewliMailable abstract base class with branded from/reply-to
- Create shared Blade layout (mail.layouts.crewli) with inline CSS
- Refactor Registration*Mail and InvitationMail to extend CrewliMailable
- Add config/crewli.php for platform-wide defaults (portal_url, app_url, logo)
- Add dev-only /mail-preview/{type} route for browser email previewing
- Update Organisation model, resource, and form requests with branding fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 00:44:34 +02:00

45 lines
1006 B
PHP

<?php
declare(strict_types=1);
namespace App\Mail;
use App\Models\Event;
use App\Models\Person;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
final class RegistrationConfirmationMail extends CrewliMailable
{
public Person $person;
public Event $event;
public function __construct(Person $person, Event $event)
{
parent::__construct($event->organisation);
$this->person = $person;
$this->event = $event;
}
public function envelope(): Envelope
{
return new Envelope(
subject: "Bevestiging aanmelding {$this->event->name}",
);
}
public function content(): Content
{
$this->buildBranding();
return new Content(
view: 'mail.registration-confirmation',
with: [
'person' => $this->person,
'event' => $this->event,
'portalUrl' => config('crewli.portal_url'),
],
);
}
}