mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENH Move email to data conversion to protected method
This commit is contained in:
parent
3601b7ab8b
commit
df1d4a4b9a
@ -41,7 +41,12 @@ class TestMailer implements MailerInterface
|
|||||||
/** @var Email $email */
|
/** @var Email $email */
|
||||||
$email = $message;
|
$email = $message;
|
||||||
$this->dispatchEvent($email, $envelope);
|
$this->dispatchEvent($email, $envelope);
|
||||||
$this->emailsSent[] = [
|
$this->emailsSent[] = $this->createData($email);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function createData(Email $email): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
'Type' => $email->getHtmlBody() ? 'html' : 'plain',
|
'Type' => $email->getHtmlBody() ? 'html' : 'plain',
|
||||||
'To' => $this->convertAddressesToString($email->getTo()),
|
'To' => $this->convertAddressesToString($email->getTo()),
|
||||||
'From' => $this->convertAddressesToString($email->getFrom()),
|
'From' => $this->convertAddressesToString($email->getFrom()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user