Files
crewli/api/app/Services/MailBrandingService.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

26 lines
719 B
PHP

<?php
declare(strict_types=1);
namespace App\Services;
use App\Models\Organisation;
final class MailBrandingService
{
/**
* @return array<string, mixed>
*/
public function getBranding(Organisation $organisation): array
{
return [
'organisation_name' => $organisation->name,
'logo_url' => $organisation->email_logo_url ?? config('crewli.default_logo_url'),
'primary_color' => $organisation->email_primary_color ?? '#6366f1',
'reply_to' => $organisation->email_reply_to,
'sender_name' => $organisation->email_sender_name ?? $organisation->name,
'footer_text' => $organisation->email_footer_text,
];
}
}