コード例 #1
0
 public function replace_keys(Emails $mail, User $local, User $is, Section $section)
 {
     $mail->setBody(str_replace('local.prenom', $local->getPrenom(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.prenom', $is->getPrenom(), $mail->getBody()));
     $mail->setBody(str_replace('local.nom', $local->getNom(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.nom', $is->getNom(), $mail->getBody()));
     $mail->setBody(str_replace('local.age', $local->getAge(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.age', $is->getAge(), $mail->getBody()));
     $mail->setBody(str_replace('local.universite', $local->getUniversite(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.universite', $is->getUniversite(), $mail->getBody()));
     if ($local->getArrival() != null) {
         $mail->setBody(str_replace('local.arrival', $local->getArrival()->format('d/m/Y'), $mail->getBody()));
     }
     if ($is->getArrival() != null) {
         $mail->setBody(str_replace('is_student.arrival', $is->getArrival()->format('d/m/Y'), $mail->getBody()));
     } else {
         $mail->setBody(str_replace(' et arrivera le is_student.arrival.', '.', $mail->getBody()));
     }
     $mail->setBody(str_replace('local.email', $local->getEmail(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.email', $is->getEmail(), $mail->getBody()));
     $mail->setBody(str_replace('local.username', $local->getUsername(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.username', $is->getUsername(), $mail->getBody()));
     $mail->setBody(str_replace('local.password', $local->getPassword(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.password', $is->getPassword(), $mail->getBody()));
     $mail->setBody(str_replace('local.nationality', $local->getNationalite(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.nationality', $is->getNationalite(), $mail->getBody()));
     $mail->setBody(str_replace('section.name', $section->getName(), $mail->getBody()));
     return $mail;
 }
コード例 #2
0
 private function replace_keys(Emails $mail, User $is)
 {
     $mail->setBody(str_replace('is_student.prenom', $is->getPrenom(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.nom', $is->getNom(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.age', $is->getAge(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.universite', $is->getUniversite(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.email', $is->getEmail(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.username', $is->getUsername(), $mail->getBody()));
     $mail->setBody(str_replace('is_student.password', $this->plainpass, $mail->getBody()));
     $mail->setBody(str_replace('is_student.nationality', $is->getNationalite(), $mail->getBody()));
     $mail->setBody(str_replace('section.name', $this->sectionManager->getCurrentSection()->getName(), $mail->getBody()));
     return $mail;
 }
コード例 #3
0
 public function sendEmail(User $user)
 {
     $message = \Swift_Message::newInstance()->setSubject('[BuddySystem] Renouveler l\'expérience')->setFrom('*****@*****.**')->setTo($user->getEmail())->setBody($this->getContainer()->get('templating')->render('BuddySystemMainBundle:Emails:renewing.html.twig', array('user' => $user)), 'text/html');
     $this->getContainer()->get('mailer')->send($message);
 }
コード例 #4
0
 public function sendEmail(User $user)
 {
     $message = \Swift_Message::newInstance()->setSubject('[BuddySystem] Welcoming international students in France, help us improve it')->setFrom('*****@*****.**')->setTo($user->getEmail())->setBody($this->getContainer()->get('templating')->render('BuddySystemMainBundle:Emails:welcomingis.html.twig'), 'text/html');
     $this->getContainer()->get('mailer')->send($message);
 }
コード例 #5
0
 private function replace_keys(Emails $mail, User $local)
 {
     $mail->setBody(str_replace('local.prenom', $local->getPrenom(), $mail->getBody()));
     $mail->setBody(str_replace('local.nom', $local->getNom(), $mail->getBody()));
     $mail->setBody(str_replace('local.age', $local->getAge(), $mail->getBody()));
     $mail->setBody(str_replace('local.universite', $local->getUniversite(), $mail->getBody()));
     $mail->setBody(str_replace('local.email', $local->getEmail(), $mail->getBody()));
     $mail->setBody(str_replace('local.username', $local->getUsername(), $mail->getBody()));
     $mail->setBody(str_replace('local.password', $this->plainpass, $mail->getBody()));
     $mail->setBody(str_replace('local.nationality', $local->getNationalite(), $mail->getBody()));
     $mail->setBody(str_replace('section.name', $this->section->getName(), $mail->getBody()));
     return $mail;
 }