|
@@ -132,5 +132,21 @@ class SecurityController extends Controller
|
|
));
|
|
));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @Route("/admin/sendmailtest/{id}", name="admin_sendmailtest")
|
|
|
|
+ */
|
|
|
|
+ public function sendMailTestAction(\Swift_Mailer $mailer, User $user)
|
|
|
|
+ {
|
|
|
|
+ $swiftMessage = new \Swift_Message('Mail de test pour la vidéothèque');
|
|
|
|
+ $message = $swiftMessage
|
|
|
|
+ ->setFrom('admin@fdlibre.eu')
|
|
|
|
+ ->setTo($user->getMail())
|
|
|
|
+ ->setBody("Salut ".$user->getUsername().", Ceci est un mail de test de l'application Videotheque.");
|
|
|
|
+
|
|
|
|
+ $mailer->send($message);
|
|
|
|
+ $this->addFlash('success', 'Le mail a été envoyé à '.$user->getUsername());
|
|
|
|
+ return $this->redirectToRoute('admin_index');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|