from(new Address($this->from, $this->name)) ->to($to) ->subject($subject) ->text($body) ->replyTo(new Address($this->reply, $this->name)); $this->mailer->send($mail); } public function sendMailActivation(User $user, string $lien): void { $subject = "Activation de votre compte"; $template = 'security/mail_activate.html.twig'; $to = $user->getMail(); $body = $this->templating->render($template, ['user' => $user, 'lien' => $lien]); $this->sendMessage($subject, $to, $body); } public function sendMailDemandeActivation(User $user, string $lien): void { $subject = "Demande d'activation"; $template = 'security/mail_demande_activation.html.twig'; $to = $this->from; $body = $this->templating->render($template, ['user' => $user, 'lien' => $lien]); $this->sendMessage($subject, $to, $body); } public function sendMailTokenMp(User $user, string $lien): void { $subject = "Mot de passe perdu"; $template = 'security/mail_tokenmdp.html.twig'; $to = $user->getMail(); $body = $this->templating->render($template, ['user' => $user, 'lien' => $lien]); $this->sendMessage($subject, $to, $body); } }