protected function send(Payment $payment) { //si on a pas associé l'intent alors pas d'email if ($payment->getIntent()) { $body = $this->templating->render('DonateFrontBundle:Mail:thanks.txt.twig', array('intent' => $payment->getIntent(), 'payment' => $payment)); $message = \Swift_Message::newInstance()->setSubject($this->translator->trans('Thank you for your generosity'))->setFrom($this->noreply)->setTo($payment->getIntent()->getCustomer()->getEmail())->setBody($body, 'text/html'); $this->mailer->send($message); } }