private function sendConfirmMail(Configuration $configuration, ContactInterface $model) { $text = $this->templating->render($configuration->getConfirmTemplate(), ['data' => $model]); $subject = $this->translator->trans($configuration->getSubject(), [], $configuration->getTranslationDomain()); $message = \Swift_Message::newInstance()->setSubject($subject)->setFrom($configuration->getFrom())->setTo($model->getEmail())->setBody($text, 'text/html'); $this->mailer->send($message); }
protected function sendMailToSender(ContactInterface $contact) { $text = $this->renderView($this->container->getParameter('enhavo_contact.contact.template.sender'), array('contact' => $contact)); $message = \Swift_Message::newInstance()->setSubject($this->get('translator')->trans($this->container->getParameter('enhavo_contact.contact.subject'), array(), $this->container->getParameter('enhavo_contact.contact.translationDomain')))->setFrom($this->container->getParameter('enhavo_contact.contact.from'))->setTo($contact->getEmail())->setBody($text); $this->get('mailer')->send($message); }