|
| | __construct (private email_catcher readonly email_catcher $client, private string readonly string $id, private stdClass readonly stdClass $sender, private string readonly string $subject, private array readonly array $recipients, private array readonly array $cc=[], private array readonly array $bcc=[], private int readonly int $attachmentcount=0, private ?string ?string $text=null, private ?string ?string $html=null, private array array $attachments=[], private array array $inline=[],) |
| | Constructor.
|
| |
|
| load_message_content () |
| | Load the message content.
|
| |
|
|
bool bool | $messageloaded = false |
| | Whether the message has been loaded.
|
| |
◆ __construct()
| core\test\mailpit_message::__construct |
( |
private email_catcher readonly email_catcher | $client, |
|
|
private string readonly string | $id, |
|
|
private stdClass readonly stdClass | $sender, |
|
|
private string readonly string | $subject, |
|
|
private array readonly array | $recipients, |
|
|
private array readonly array | $cc = [], |
|
|
private array readonly array | $bcc = [], |
|
|
private int readonly int | $attachmentcount = 0, |
|
|
private ?string ?string | $text = null, |
|
|
private ?string ?string | $html = null, |
|
|
private array array | $attachments = [], |
|
|
private array array | $inline = [] ) |
|
protected |
Constructor.
- Parameters
-
| email_catcher | $client | The email catcher client. |
| string | $id | The message ID. |
| stdClass | $sender | The sender. |
| string | $subject | The subject. |
| array | $recipients | The recipients. |
| array | $cc | The cc recipients. |
| array | $bcc | The bcc recipients. |
| int | $attachmentcount | The number of attachments. |
| string | null | $text | The text body. |
| string | null | $html | The HTML body. |
| array | $attachments | The attachments. |
| array | $inline | The inline attachments. |
- Parameters
-
| $client | $client The email catcher client used for message operations. |
| $id | $id The unique identifier for the message. |
| $sender | $sender The sender of the message, represented as an object with email details. |
| $subject | $subject The subject line of the message. |
| $recipients | $recipients List of primary recipients for the message. |
| $cc | $cc List of carbon copy recipients (optional, defaults to an empty array). |
| $bcc | $bcc List of blind carbon copy recipients (optional, defaults to an empty array). |
| $attachmentcount | $attachmentcount The number of attachments in the message (default is 0). |
| $text | $text The plain text body of the message (nullable, might be loaded later). |
| $html | $html The HTML body of the message (nullable, might be loaded later). |
| $attachments | $attachments An array of attachment details (defaults to empty array). |
| $inline | $inline An array of inline elements like images or styles (defaults to empty array). |
◆ create_from_api_response()
| static core\test\mailpit_message::create_from_api_response |
( |
email_catcher | $client, |
|
|
stdClass | $message, |
|
|
bool | $showdetails = false ) |
|
static |
Create a message from an api response.
- Parameters
-
| email_catcher | $client | The email catcher client. |
| stdClass | $message | The api response. |
| bool | $showdetails | Optional. Whether to include detailed information in the messages. Default is false. |
- Return values
-
| mailpit_message | The created mailpit message instance. |
◆ get_bcc()
| core\test\mailpit_message::get_bcc |
( |
| ) |
|
Get the message bcc recipients.
- Return values
-
| iterable | The bcc recipients. |
Implements core\test\message.
◆ get_body_html()
| core\test\mailpit_message::get_body_html |
( |
| ) |
|
Get the HTML representation of the body, if one was provided.
- Return values
-
| null|string | The HTML body. |
Implements core\test\message.
◆ get_body_text()
| core\test\mailpit_message::get_body_text |
( |
| ) |
|
Get the text representation of the body, if one was provided.
- Return values
-
| null|string | The text body. |
Implements core\test\message.
◆ get_cc()
| core\test\mailpit_message::get_cc |
( |
| ) |
|
Get the message cc recipients.
- Return values
-
| iterable | The cc recipients. |
Implements core\test\message.
◆ get_first_recipient()
| core\test\mailpit_message::get_first_recipient |
( |
| ) |
|
Get the first recipient of the message.
- Return values
-
| string | The email address of the first recipient. |
◆ get_id()
| core\test\mailpit_message::get_id |
( |
| ) |
|
Get the message ID.
- Return values
-
◆ get_recipients()
| core\test\mailpit_message::get_recipients |
( |
| ) |
|
◆ get_sender()
| core\test\mailpit_message::get_sender |
( |
| ) |
|
◆ get_subject()
| core\test\mailpit_message::get_subject |
( |
| ) |
|
◆ has_recipient()
| core\test\mailpit_message::has_recipient |
( |
string | $email | ) |
|
Whether the message has the specified recipient.
- Parameters
-
| string | $email | The email address. |
- Return values
-
| bool | Whether the message has the recipient. |
Implements core\test\message.
The documentation for this class was generated from the following file:
- lib/classes/test/mailpit_message.php