Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
root
/
proc
/
self
/
root
/
proc
/
212
/
task
/
212
/
root
/
proc
/
70528
/
cwd
/
src
/
Service
/
//proc/212/root/proc/self/root/proc/212/task/212/root/proc/70528/cwd/src/Service/MailerService.php
<?php namespace App\Service; use App\Entity\Command; use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\Transport\TransportInterface; use Symfony\Component\Mime\Address; class MailerService { private $mailer; public function __construct(TransportInterface $mailerInterface) { $this->mailer = $mailerInterface; } public function sendStatusMail($status, $command) { if ($command->getUser()) { $clientEmail = $command->getUser()->getEmail(); } else { $clientEmail = $command->getGuest()->getEmail(); } $email = (new TemplatedEmail()) ->to($clientEmail) ->from(new Address('noreply@bhinternet-email.fr', 'Commandes - IG Print')) ->subject("Mise à jour de votre commande") ->htmlTemplate("front/email/status.html.twig") ->context([ "status" => $status, "command" => $command ]); $this->mailer->send($email); } public function sendCommand(Command $command, $email) { $email = (new TemplatedEmail()) ->to($email) ->from(new Address('noreply@bhinternet-email.fr', 'Commandes - IG Print')) ->subject("Nouvelle commande reçue") ->htmlTemplate("front/email/new-command.html.twig") ->context([ "command" => $command ]); $this->mailer->send($email); } public function sendCommandConfirmation($command) { if ($command->getUser()) { $clientEmail = $command->getUser()->getEmail(); } else { $clientEmail = $command->getGuest()->getEmail(); } $email = (new TemplatedEmail()) ->to($clientEmail) ->from(new Address('noreply@bhinternet-email.fr', 'Commandes - IG Print')) ->subject("Confirmation de commande") ->htmlTemplate("front/email/command-confirmation.html.twig") ->context([ "command" => $command ]); $this->mailer->send($email); } }