- 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>
28 lines
971 B
PHP
28 lines
971 B
PHP
<?php
|
|
|
|
use App\Mail\InvitationMail;
|
|
use App\Mail\RegistrationApprovedMail;
|
|
use App\Mail\RegistrationConfirmationMail;
|
|
use App\Mail\RegistrationRejectedMail;
|
|
use App\Models\Event;
|
|
use App\Models\Organisation;
|
|
use App\Models\Person;
|
|
use App\Models\UserInvitation;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
if (app()->environment('local', 'staging')) {
|
|
Route::get('/mail-preview/{type}', function (string $type) {
|
|
$org = Organisation::first();
|
|
$event = Event::first();
|
|
$person = Person::first();
|
|
|
|
return match ($type) {
|
|
'registration-confirmation' => new RegistrationConfirmationMail($person, $event),
|
|
'registration-approved' => new RegistrationApprovedMail($person, $event),
|
|
'registration-rejected' => new RegistrationRejectedMail($person, $event, 'Helaas geen plek meer.'),
|
|
'invitation' => new InvitationMail(UserInvitation::first()),
|
|
default => abort(404),
|
|
};
|
|
});
|
|
}
|