From df1d4a4b9abe855a75bd70fb1d6c11804e545d79 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 21 Oct 2022 15:54:06 +1300 Subject: [PATCH] ENH Move email to data conversion to protected method --- src/Dev/TestMailer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Dev/TestMailer.php b/src/Dev/TestMailer.php index 99e1b204f..7bfe228ac 100644 --- a/src/Dev/TestMailer.php +++ b/src/Dev/TestMailer.php @@ -41,7 +41,12 @@ class TestMailer implements MailerInterface /** @var Email $email */ $email = $message; $this->dispatchEvent($email, $envelope); - $this->emailsSent[] = [ + $this->emailsSent[] = $this->createData($email); + } + + protected function createData(Email $email): array + { + return [ 'Type' => $email->getHtmlBody() ? 'html' : 'plain', 'To' => $this->convertAddressesToString($email->getTo()), 'From' => $this->convertAddressesToString($email->getFrom()),