From 9f2ba7dbcbda2e2f45094a6d2f4ea84fb6d43338 Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Tue, 7 Jul 2020 09:50:15 +0200 Subject: [PATCH] FEATURE: Add a mail command (not only) for testing This adds the command mail:send to send a mail through swiftmailer. --- Classes/Command/EmailCommandController.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Classes/Command/EmailCommandController.php diff --git a/Classes/Command/EmailCommandController.php b/Classes/Command/EmailCommandController.php new file mode 100644 index 0000000..5f3fcf4 --- /dev/null +++ b/Classes/Command/EmailCommandController.php @@ -0,0 +1,44 @@ +setFrom($from) + ->setTo($to) + ->setSubject($subject) + ->setBody($body) + ->setContentType($contentType); + + $sentMessages = $message->send(); + + $this->outputLine(sprintf('%s emails were successfully sent.', $sentMessages)); + } +}