/** * @Post("/boats/email/{boat}") * @ParamConverter("boat", class="Xaj\ErgoBundle\Entity\Boat", options={"id" = "boat"}) * @View() */ public function sendRecapMailAction(Boat $boat) { $message = \Swift_Message::newInstance()->setSubject('Confirmation de votre inscription à ErgometriX 2014')->setFrom('*****@*****.**')->setTo($boat->getLeader()->getEmail())->setBody($this->renderView('XajErgoBundle:Boat:email.html.twig')); $this->get('mailer')->send($message); return $message->getBody(); }
/** * @Post("/boats/pay-email/{boat}") * @ParamConverter("boat", class="Xaj\ErgoBundle\Entity\Boat", options={"id" = "boat"}) * @View() */ public function sendPayMailAction(Boat $boat) { $message = \Swift_Message::newInstance()->setSubject('Paiement reçu pour ErgometriX 2014')->setFrom(array('*****@*****.**' => 'ErgometriX 2014'))->setReplyTo(array('*****@*****.**' => 'ErgometriX 2014'))->setTo($boat->getLeader()->getEmail())->setBody($this->renderView('XajErgoBundle:Boat:pay-email.html.twig', array('boatName' => $boat->getName())), 'text/html')->addPart($this->renderView('XajErgoBundle:Boat:pay-email-plaintext.html.twig', array('boatName' => $boat->getName())), 'text/plain'); $this->get('mailer')->send($message); return $message->getBody(); }