Files
gnilebeinandClaude Sonnet 5.5 72b688186f
CI / Deploy / PHP 8.5 (push) Successful in 1m6s
CI / Deploy / PHP 8.4 (push) Successful in 1m10s
CI / Deploy / test (push) Successful in 2s
CI / Deploy / deploy (push) Skipped
Add the logo and the web wordmark colors to e-mails
The HTML layout now shows the logo (inline CID attachment, generated with
the favicon script) before "Plenar" in the text color and "IO" in the primary
color, like the site header. Muted gray and background match the web tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 15:08:13 +01:00

32 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Test\TestCase\Mailer;
use App\Mailer\PollMailer;
use App\Test\TestCase\PlenarioTestTrait;
use Cake\TestSuite\EmailTrait;
use Cake\TestSuite\TestCase;
class PollMailerTest extends TestCase
{
use EmailTrait;
use PlenarioTestTrait;
public function testHtmlMailShowsLogoAndWebColors(): void
{
[$poll] = $this->createPoll('Retro', 'owner@example.org');
$this->assertTrue((new PollMailer())->sendSafely('expiryReminder', [$poll, 'https://example.org/admin/x']));
$this->assertMailCount(1);
$this->assertMailContainsAttachment('logo.png');
// The logo is referenced by Content-ID, not by a URL that images-off clients would block.
$this->assertMailContainsHtml('src="cid:' . PollMailer::LOGO_CID . '"');
// Brand and text colors as on the web (--text, --primary, --muted), not the old off-by-a-bit values.
$this->assertMailContainsHtml('Plenar<span style="color:#4b3fe0;">IO</span>');
$this->assertMailContainsHtml('color:#5d6280');
$this->assertMailContainsHtml('background:#f5f6fb');
}
}