From 89320c5919939211392cc673042ceb246bc2355f Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Wed, 17 Jul 2024 12:24:44 +0200 Subject: [PATCH] Ensure an e-mail is valid when creating it (#352) --- src/Gateway/MailerGateway.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Gateway/MailerGateway.php b/src/Gateway/MailerGateway.php index 942c721..7d92172 100644 --- a/src/Gateway/MailerGateway.php +++ b/src/Gateway/MailerGateway.php @@ -158,6 +158,9 @@ private function createEmail(Parcel $parcel): Email $email = new Email(); $emailStamp->applyToEmail($email); + // Validate the e-mail so we throw early enough + $email->ensureValidity(); + // Adjust the priority if configured to do so if (($priority = $parcel->getMessageConfig()->getInt('email_priority')) > 0) { $email = $email->priority($priority);