From 97d656912c829fcf38f23e9706c2fe59c31c9c4c Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 2 Jul 2024 01:41:33 -0400 Subject: [PATCH] migrate email to use Util class and method --- src/Utils/Utils.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Utils/Utils.php diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php new file mode 100644 index 0000000..d15f4b5 --- /dev/null +++ b/src/Utils/Utils.php @@ -0,0 +1,35 @@ +from($from) + ->to($to) + ->subject($subject) + ->replyTo($from) + ->html($content); + + try { + $mailer->send($mail); + } catch (TransportExceptionInterface $e) { + die($e->getMessage()); + // some error prevented the email sending; display an + // error message or try to resend the message + } + } +}