1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

send mail to owner added, return response 200

This commit is contained in:
Baptiste Lemoine 2020-04-10 17:21:31 +02:00
parent 61cdafe3b8
commit 3f2ac02b65

View File

@ -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
}