Brand Frontdesk Laravel mail for hosts and report recipients.
Deploy Ladill Frontdesk / deploy (push) Has been cancelled
Deploy Ladill Frontdesk / deploy (push) Has been cancelled
Pass organization logo/name through ContactMessageMail for daily reports and campaigns, and drop the Ladill product footer. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -121,4 +121,37 @@ class FrontdeskEmailBrandingTest extends TestCase
|
||||
&& ! str_contains($html, 'Sent via Ladill');
|
||||
});
|
||||
}
|
||||
|
||||
public function test_laravel_mail_uses_organization_branding(): void
|
||||
{
|
||||
Storage::fake('public');
|
||||
\Illuminate\Support\Facades\Mail::fake();
|
||||
|
||||
$path = UploadedFile::fake()->image('hq-logo.png', 400, 120)
|
||||
->store('frontdesk/organizations/'.$this->organization->id, 'public');
|
||||
$this->organization->update(['logo_path' => $path]);
|
||||
|
||||
$logoUrl = OrganizationBranding::emailLogoUrl($this->organization->fresh());
|
||||
|
||||
$sent = app(\App\Services\Comms\EmailService::class)->send(
|
||||
'admin@example.com',
|
||||
'Daily summary',
|
||||
"Visitors checked in: 3\nDeliveries: 1",
|
||||
$this->organization->name,
|
||||
null,
|
||||
$this->organization->fresh(),
|
||||
);
|
||||
|
||||
$this->assertTrue($sent);
|
||||
|
||||
\Illuminate\Support\Facades\Mail::assertSent(\App\Mail\ContactMessageMail::class, function (\App\Mail\ContactMessageMail $mail) use ($logoUrl) {
|
||||
$html = $mail->render();
|
||||
|
||||
return $mail->logoUrl === $logoUrl
|
||||
&& $mail->companyName === 'Frontdesk HQ'
|
||||
&& str_contains($html, 'Frontdesk HQ')
|
||||
&& str_contains($html, $logoUrl)
|
||||
&& ! str_contains($html, 'Sent via Ladill');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user