From 98dd56e191512aac479ee6d5f1478edb4a2ccb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Delmaire=20Lo=C3=AFc?= Date: Wed, 22 Jan 2025 11:27:30 +0100 Subject: [PATCH] Add homologation message within approve mail for specific definitions Ref https://linear.app/pole-api/issue/DAT-245 --- app/models/authorization_definition.rb | 4 ++++ app/views/authorization_request_mailer/approve.text.erb | 9 +++++++++ config/locales/mailer.fr.yml | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/app/models/authorization_definition.rb b/app/models/authorization_definition.rb index d759b83bd..f6f735b4b 100644 --- a/app/models/authorization_definition.rb +++ b/app/models/authorization_definition.rb @@ -53,6 +53,10 @@ def reopenable? !next_stage? end + def need_homologation? + %w[api_entreprise api_particulier].include?(id) + end + def instructors User.instructor_for(id) end diff --git a/app/views/authorization_request_mailer/approve.text.erb b/app/views/authorization_request_mailer/approve.text.erb index d8ad37767..3de22e1fd 100644 --- a/app/views/authorization_request_mailer/approve.text.erb +++ b/app/views/authorization_request_mailer/approve.text.erb @@ -9,4 +9,13 @@ ) %> +<% if @authorization_request.definition.need_homologation? %> + <%= + t( + '.need_homologation', + authorization_definition_name: @authorization_request.definition.name, + ) + %> +<% end %> + <%= render partial: 'mailer/shared/applicant/footer', locals: { authorization_definition_name: @authorization_request.definition.name } %> diff --git a/config/locales/mailer.fr.yml b/config/locales/mailer.fr.yml index 51c912ecf..635ea2891 100644 --- a/config/locales/mailer.fr.yml +++ b/config/locales/mailer.fr.yml @@ -29,6 +29,11 @@ fr: Votre habilitation "%{authorization_request_name}" (numéro %{authorization_request_id}) a été validée par nos équipes. Vous pouvez consulter votre habilitation en suivant le lien suivant: %{authorization_request_url} + + need_homologation: | + L'utilisation de %{authorization_definition_name} nécessite d’homologuer* l’application destinatrice des données et que votre registre de traitement mentionne les données d’appelle collectées et les données reçues. + + *L’anssi vous accompagne dans la sécurisation de vos application : https://www.monservicesecurise.cyber.gouv.fr refuse: subject: Votre demande d'habilitation numéro %{authorization_request_id} a été refusée description: |