Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
EmailMessage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace App\Domain\Notification\Data;
6
7/**
8 * Immutable DTO representing an outbound email message.
9 */
10final readonly class EmailMessage
11{
12    public function __construct(
13        public string $to,
14        public string $subject,
15        public string $bodyHtml,
16        public ?string $toName = null,
17        public ?string $bodyText = null,
18        public ?string $from = null,
19        public ?string $fromName = null,
20        /**
21         * Fail-safe default: when true (the default), the in-app email history
22         * stores metadata only — never the body — so reset tokens / PII can't
23         * be persisted. Senders of non-sensitive mail (notifications, etc.)
24         * pass false to opt the body into storage. See RecordingEmailService.
25         */
26        public bool $sensitive = true,
27    ) {}
28}