Add settings logo upload and brand queue notification emails.
Deploy Ladill Queue / deploy (push) Successful in 55s
Deploy Ladill Queue / deploy (push) Successful in 55s
Let orgs manage logos in settings and render customer-facing mail with company branding. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -54,4 +54,27 @@ class OrganizationBranding
|
||||
Storage::disk('public')->delete($organization->logo_path);
|
||||
}
|
||||
}
|
||||
|
||||
public static function emailLogoUrl(Organization $organization): ?string
|
||||
{
|
||||
if (! self::hasCustomLogo($organization)) {
|
||||
return null;
|
||||
}
|
||||
$ext = strtolower(pathinfo($organization->logo_path, PATHINFO_EXTENSION));
|
||||
if ($ext === 'svg') {
|
||||
return null;
|
||||
}
|
||||
$version = $organization->updated_at?->getTimestamp() ?? time();
|
||||
|
||||
return Storage::disk('public')->url($organization->logo_path).'?v='.$version;
|
||||
}
|
||||
|
||||
public static function wrapEmailHtml(string $bodyHtml, Organization $organization): string
|
||||
{
|
||||
return view('email.customer-branded', [
|
||||
'logoUrl' => self::emailLogoUrl($organization),
|
||||
'companyName' => $organization->name,
|
||||
'bodyHtml' => $bodyHtml,
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user