MailEntry
API reference › Debug Core › Panel › Mail › MailEntry
Typed view-model for a single mail message rendered in the Mail panel detail view.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
create() static | Creates a captured message from the envelope fields every mailer reports. | MailEntry |
failedCount() static | Counts the messages the mailer rejected. | MailEntry |
fromArray() static | Narrows one persisted message of the mail payload into a typed entry. | MailEntry |
fromCapture() static | Narrows one captured EVENT_AFTER_SEND payload into a typed message. | MailEntry |
getBcc() | Returns the blind carbon-copy recipients. | MailEntry |
getBody() | Returns the captured plain-text body. | MailEntry |
getCc() | Returns the carbon-copy recipients. | MailEntry |
getCharset() | Returns the charset declared on the message. | MailEntry |
getFile() | Returns the path of the message the mailer persisted. | MailEntry |
getFrom() | Returns the sender address as captured. | MailEntry |
getHeaders() | Returns the raw message headers as captured. | MailEntry |
getReplyTo() | Returns the reply-to addresses. | MailEntry |
getSubject() | Returns the subject line as captured. | MailEntry |
getTime() | Returns the capture timestamp. | MailEntry |
getTo() | Returns the primary recipients. | MailEntry |
isSuccessful() | Reports whether the mailer delivered the message. | MailEntry |
jsonSerialize() | Serializes the message into its persisted payload. | MailEntry |
withBcc() | Returns a copy with the blind carbon-copy recipients. | MailEntry |
withBody() | Returns a copy with the captured body. | MailEntry |
withCc() | Returns a copy with the carbon-copy recipients. | MailEntry |
withCharset() | Returns a copy with the declared charset. | MailEntry |
withFile() | Returns a copy with the persisted message file. | MailEntry |
withHeaders() | Returns a copy with the raw message headers. | MailEntry |
withReplyTo() | Returns a copy with the reply-to addresses. | MailEntry |
withTime() | Returns a copy with the capture timestamp. | MailEntry |
Method details
Section titled “Method details”create()
Section titled “create() ”public static function create(string $from, list<string> $to, string $subject, bool $isSuccessful): selfCreates a captured message from the envelope fields every mailer reports.
Parameters
| Parameter | Type | Description |
|---|---|---|
$from | string | Sender address as captured. |
$to | list<string> | Primary recipients, with empty entries dropped. |
$subject | string | Subject line as captured. |
$isSuccessful | bool | Whether the mailer reported the message as sent. |
Returns
self: Message carrying the envelope, without body, headers, or capture time.
failedCount()
Section titled “failedCount() ”public static function failedCount(list<self> $models): intCounts the messages the mailer rejected.
Parameters
| Parameter | Type | Description |
|---|---|---|
$models | list<self> | Captured messages. |
Returns
int: Number of messages reported as failed.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows one persisted message of the mail payload into a typed entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted message, expected to be an object carrying the declared shape. |
$path | string | JSON path of the message, used to report a malformed payload. |
Returns
self: Message carrying every persisted field.
fromCapture()
Section titled “fromCapture() ”public static function fromCapture(array<array-key, mixed> $row): selfNarrows one captured EVENT_AFTER_SEND payload into a typed message.
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | array<array-key, | Captured payload. |
Returns
self: Message carrying every field the mailer exposed.
getBcc()
Section titled “getBcc() ”public function getBcc(): list<string>Returns the blind carbon-copy recipients.
Returns
list<string>: Blind carbon-copy recipients in capture order.
getBody()
Section titled “getBody() ”public function getBody(): stringReturns the captured plain-text body.
Returns
string: Plain-text body, or '' when the message had none.
getCc()
Section titled “getCc() ”public function getCc(): list<string>Returns the carbon-copy recipients.
Returns
list<string>: Carbon-copy recipients in capture order.
getCharset()
Section titled “getCharset() ”public function getCharset(): stringReturns the charset declared on the message.
Returns
string: Declared charset, or '' when none was set.
getFile()
Section titled “getFile() ”public function getFile(): stringReturns the path of the message the mailer persisted.
Returns
string: Path to the persisted .eml file, or '' when the mailer exposes none.
getFrom()
Section titled “getFrom() ”public function getFrom(): stringReturns the sender address as captured.
Returns
string: Sender address as captured.
getHeaders()
Section titled “getHeaders() ”public function getHeaders(): stringReturns the raw message headers as captured.
Returns
string: Raw RFC-5322 headers, joined with line breaks.
getReplyTo()
Section titled “getReplyTo() ”public function getReplyTo(): list<string>Returns the reply-to addresses.
Returns
list<string>: Reply-to addresses in capture order.
getSubject()
Section titled “getSubject() ”public function getSubject(): stringReturns the subject line as captured.
Returns
string: Subject line as captured.
getTime()
Section titled “getTime() ”public function getTime(): int|nullReturns the capture timestamp.
Returns
int|null: Capture timestamp as a Unix-epoch second, or null when the payload carried no parseable time.
getTo()
Section titled “getTo() ”public function getTo(): list<string>Returns the primary recipients.
Returns
list<string>: Primary recipients in capture order.
isSuccessful()
Section titled “isSuccessful() ”public function isSuccessful(): boolReports whether the mailer delivered the message.
Returns
bool: true when the mailer reported the message as sent.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Serializes the message into its persisted payload.
Returns
array<string, mixed>
withBcc()
Section titled “withBcc() ”public function withBcc(list<string> $bcc): selfReturns a copy with the blind carbon-copy recipients.
Parameters
| Parameter | Type | Description |
|---|---|---|
$bcc | list<string> | Recipients in capture order. |
Returns
self: New instance carrying the requested recipients.
withBody()
Section titled “withBody() ”public function withBody(string $body): selfReturns a copy with the captured body.
Parameters
| Parameter | Type | Description |
|---|---|---|
$body | string | Plain-text body, or '' when the message had none. |
Returns
self: New instance carrying the requested body.
withCc()
Section titled “withCc() ”public function withCc(list<string> $cc): selfReturns a copy with the carbon-copy recipients.
Parameters
| Parameter | Type | Description |
|---|---|---|
$cc | list<string> | Recipients in capture order. |
Returns
self: New instance carrying the requested recipients.
withCharset()
Section titled “withCharset() ”public function withCharset(string $charset): selfReturns a copy with the declared charset.
Parameters
| Parameter | Type | Description |
|---|---|---|
$charset | string | Charset declared on the message, or '' when none was set. |
Returns
self: New instance carrying the requested charset.
withFile()
Section titled “withFile() ”public function withFile(string $file): selfReturns a copy with the persisted message file.
Parameters
| Parameter | Type | Description |
|---|---|---|
$file | string | Path to the .eml file, or '' when the mailer exposes none. |
Returns
self: New instance carrying the requested file.
withHeaders()
Section titled “withHeaders() ”public function withHeaders(string $headers): selfReturns a copy with the raw message headers.
Parameters
| Parameter | Type | Description |
|---|---|---|
$headers | string | Raw RFC-5322 headers, joined with line breaks. |
Returns
self: New instance carrying the requested headers.
withReplyTo()
Section titled “withReplyTo() ”public function withReplyTo(list<string> $replyTo): selfReturns a copy with the reply-to addresses.
Parameters
| Parameter | Type | Description |
|---|---|---|
$replyTo | list<string> | Addresses in capture order. |
Returns
self: New instance carrying the requested addresses.
withTime()
Section titled “withTime() ”public function withTime(int|null $time): selfReturns a copy with the capture timestamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
$time | int| | Unix-epoch second, or null when the payload carried no parseable time. |
Returns
self: New instance carrying the requested timestamp.