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:
parent
61cdafe3b8
commit
3f2ac02b65
@ -50,11 +50,18 @@ class DefaultController extends AbstractController {
|
|||||||
$templateVars
|
$templateVars
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
// send email
|
||||||
$mailer->send( $message );
|
$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( [
|
return $this->json( [
|
||||||
'message' => 'no user found for email ' . $email,
|
'message' => 'no user found for email ' . $email,
|
||||||
'data' => '',
|
'data' => '',
|
||||||
@ -62,8 +69,8 @@ class DefaultController extends AbstractController {
|
|||||||
400 );
|
400 );
|
||||||
}
|
}
|
||||||
// find user by email
|
// find user by email
|
||||||
// send email
|
|
||||||
// user not found case
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user