diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 0412c62..5d0c23d 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -50,11 +50,18 @@ class DefaultController extends AbstractController { $templateVars ) ); + // send email $mailer->send( $message ); - return $this->render( 'emails/owner-list.html.twig', $templateVars ); + return $this->json( [ + 'message' => 'mail succefully sent to user ' . $email, + 'data' => '', + ], + 200 ); - } else { + + + } else { // user not found case return $this->json( [ 'message' => 'no user found for email ' . $email, 'data' => '', @@ -62,8 +69,8 @@ class DefaultController extends AbstractController { 400 ); } // find user by email - // send email - // user not found case + + }