I would know if API Platform is reliable to Swift Mailer. In fact, I woul use Swift Mailer to send a email when a new task has add. It works good when I use my controller, but not working with Postman or Swagger UI.
//mail sending
$message = (new \Swift_Message('New task has done !'))
->setContentType('text/html')
->setFrom("fromAdresse@sample.fr")
->setTo('sample@email.com')
->setBody(
$this->renderView('email/new.html.twig',
['work' => $work]));
$mailer->send($message);
I would use the same thing when users pass by the API UI, it's possible to handle the request ? Because controller and API hasn't the same route.
API : /api/works (POST) to add an element
Controller : work/new (POST) to add an element too
How I can use Swift Mailer on the API platform Request ? Or How I can handle the request with custom controller ?
Thx for advice and answers, I'm beginer with both.