mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Layout for the email to external
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\MainBundle\Workflow\Messenger;
|
||||
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflowSend;
|
||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||
use Chill\MainBundle\Workflow\EntityWorkflowManager;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
|
||||
@@ -25,6 +26,7 @@ final readonly class PostSendExternalMessageHandler implements MessageHandlerInt
|
||||
private EntityWorkflowRepository $entityWorkflowRepository,
|
||||
private MailerInterface $mailer,
|
||||
private BodyRendererInterface $bodyRenderer,
|
||||
private EntityWorkflowManager $workflowManager,
|
||||
) {}
|
||||
|
||||
public function __invoke(PostSendExternalMessage $message): void
|
||||
@@ -42,9 +44,12 @@ final readonly class PostSendExternalMessageHandler implements MessageHandlerInt
|
||||
|
||||
private function sendEmailToDestinee(EntityWorkflowSend $send, PostSendExternalMessage $message): void
|
||||
{
|
||||
$entityWorkflow = $send->getEntityWorkflowStep()->getEntityWorkflow();
|
||||
$title = $this->workflowManager->getHandler($entityWorkflow)->getEntityTitle($entityWorkflow);
|
||||
$email = new TemplatedEmail();
|
||||
$email
|
||||
->to($send->getDestineeThirdParty()?->getEmail() ?? $send->getDestineeEmail())
|
||||
->subject($title)
|
||||
->htmlTemplate('@ChillMain/Workflow/workflow_send_external_email_to_destinee.html.twig')
|
||||
->context([
|
||||
'send' => $send,
|
||||
|
Reference in New Issue
Block a user