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>
32 lines
1.1 KiB
PHP
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');
|
|
}
|
|
}
|