diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_send_external_email_to_destinee.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_send_external_email_to_destinee.html.twig index 3dc31f1a6..865683d1f 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_send_external_email_to_destinee.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_send_external_email_to_destinee.html.twig @@ -1,6 +1,88 @@ - -Un message vous a été envoyé. Vous pouvez le consulter à cette adresse - -{{ absolute_url(path('chill_main_workflow_send_view_public', {'uuid': send.uuid, 'verificationKey': send.privateToken})) }} - -{{ 'workflow.send_external_message.document_available_until'|trans({ 'expiration': send.expireAt}, null, lang) }} + + + +{%- set previous = send.entityWorkflowStepChained.previous -%} +{%- if previous.transitionBy is not null -%} + {%- set sender = previous.transitionBy|chill_entity_render_string -%} +{%- else -%} + {%- set sender = 'workflow.send_external_message.sender_system_user'|trans -%} +{%- endif -%} + +
+ + + + + + +
+
+ {{ 'workflow.send_external_message.greeting'|trans }}, +
+
+ {{ 'workflow.send_external_message.explanation'|trans({'sender': sender}) }} +
+
+ {{ 'workflow.send_external_message.confidentiality'|trans }} +
+ +
+ {{ 'workflow.send_external_message.document_available_until'|trans({ 'expiration': send.expireAt}, null, lang) }} +
+
+ {{ 'workflow.send_external_message.or_see_link'|trans }} : +
+
+ {{ absolute_url(path('chill_main_workflow_send_view_public', {'uuid': send.uuid, 'verificationKey': send.privateToken})) }} +
+
+
+ + diff --git a/src/Bundle/ChillMainBundle/Workflow/Messenger/PostSendExternalMessageHandler.php b/src/Bundle/ChillMainBundle/Workflow/Messenger/PostSendExternalMessageHandler.php index afeefb2f7..e81626d5f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Messenger/PostSendExternalMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Workflow/Messenger/PostSendExternalMessageHandler.php @@ -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, diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index a759d4bef..1bb5230d9 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -69,6 +69,11 @@ workflow: } send_external_message: document_available_until: Le lien sera valable jusqu'au {expiration, date, long} à {expiration, time, short}. + explanation: '{sender} vous fait parvenir des documents.' + button_content: 'Consulter les documents envoyés par {sender}' + confidentiality: Nous attirons votre attention sur le fait que ces documents sont confidentiels. + see_doc_action_description: 'Voir les documents confidentiels envoyés par {sender}' + external_views: last_view_at: Dernière vue le {at, date, long} à {at, time, short} number_of_views: >- diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 67992a60f..bce38cb76 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -571,6 +571,13 @@ workflow: expired_link_title: Lien expiré expired_link_explanation: Le lien a expiré, vous ne pouvez plus visualiser ce document. + send_external_message: + greeting: Bonjour + or_see_link: 'Si le clic sur le bouton ne fonctionnait pas, vous pouvez consulter les documents en copiant le lien ci-dessous, et en l''ouvrant dans votre navigateur' + use_button: Pour accéder à ces documents, vous pouvez utiliser le bouton ci-dessous + see_docs_action_name: Voir les documents confidentiels + sender_system_user: le logiciel chill + signature_zone: title: Signatures électroniques button_sign: Signer