This wraps mail object that can be instantiated rather standalone.
Create new mail object class using MailObject
.
e.g.
class DummyMail extends MailObject
{
protected function getSubject(): string
{
return 'Hello, World!';
}
protected function getContentParams(): array
{
return [
'recipientName' => 'Jane Doe',
];
}
protected function getRecipient(): array
{
return [
'[email protected]' => 'Jane Doe',
];
}
}
Create html.php
and text.php
for HTML-formatted and plain text email respectively.
To send the object, simply.
$mail = new DummyMail();
$mail->send();
To run testing, execute
./vendor/bin/phing test