From 8811b863d8c4989e7dea36fda5cd638ca94a1ec2 Mon Sep 17 00:00:00 2001 From: sikofitt Date: Fri, 15 Jul 2016 11:28:59 -0700 Subject: [PATCH] Fixed Swiftmailer not catching Exceptions --- src/Sikofitt/Controller/ApiControllerProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Sikofitt/Controller/ApiControllerProvider.php b/src/Sikofitt/Controller/ApiControllerProvider.php index 9e92892..af6f5e5 100644 --- a/src/Sikofitt/Controller/ApiControllerProvider.php +++ b/src/Sikofitt/Controller/ApiControllerProvider.php @@ -137,13 +137,14 @@ class ApiControllerProvider implements ControllerProviderInterface { $contactFormName = $contactFormData['contact']['name']; $contactFormEmail = $contactFormData['contact']['email']; $contactFormMessage = $contactFormData['contact']['message']; - $message = $contactFormMessage . "\n\nEmail : " . $contactFormName . '<' . $contactFormEmail . '>'; + $message = sprintf("%s\n\nEmail : %s <%s>", $contactFormMessage, $contactFormName, $contactFormEmail); $failures = ''; $sent = $app['mailer']->send(\Swift_Message::newInstance() ->setSubject('[Resume] Message') ->setFrom(['no-reply@rewiv.com' => $contactFormName]) - ->setTo($app->config('app.email')) + ->setTo([$app->config('app.email') => 'No-Reply']) + ->setReplyTo([$contactFormEmail => $contactFormName]) ->setBody($message) , $failures); if($sent > 0) {