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>
This commit is contained in:
1 parent
8262411225
commit
72b688186f
9 files changed
+96
-11
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user