From 8a859402ad8039dfc299164faa6065eaf637d0d4 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 7 Feb 2023 17:36:14 +0100 Subject: [PATCH] chore(mailer): setup Services Publics+ by env var so instances can have their owns --- app/mailers/notification_mailer.rb | 2 +- app/views/layouts/mailers/_services_publics_plus.html.haml | 4 ++-- app/views/notification_mailer/send_notification.html.haml | 2 +- config/env.example.optional | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 3780e939d..89f79c1db 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -54,7 +54,7 @@ class NotificationMailer < ApplicationMailer def set_services_publics_plus return unless Dossier::TERMINE.include?(params[:state]) - @with_services_publics_plus = true + @services_publics_plus_url = ENV['SERVICES_PUBLICS_PLUS_URL'].presence end def set_dossier diff --git a/app/views/layouts/mailers/_services_publics_plus.html.haml b/app/views/layouts/mailers/_services_publics_plus.html.haml index 4370da79f..3985ffa55 100644 --- a/app/views/layouts/mailers/_services_publics_plus.html.haml +++ b/app/views/layouts/mailers/_services_publics_plus.html.haml @@ -7,10 +7,10 @@ %p{ style: 'margin: 0' } J’aide les services publics à s’améliorer : %br - = link_to 'Je donne mon avis avec Services Publics +', 'https://www.plus.transformation.gouv.fr/experience/step_1?pk_campaign=demarches-simplifiees', target: '_blank', rel: 'noopener noreferrer' + = link_to 'Je donne mon avis avec Services Publics +', @services_publics_plus_url, target: '_blank', rel: 'noopener noreferrer' %td{ width: "30%" } - = link_to 'https://www.plus.transformation.gouv.fr/experience/step_1?pk_campaign=demarches-simplifiees', target: '_blank', rel: 'noopener noreferrer' do + = link_to @services_publics_plus_url, target: '_blank', rel: 'noopener noreferrer' do = image_tag('mailer/logo-services-plus.png', height: 39, width: 121, style: 'display:block; vertical-align: middle', alt: "Services Publics +") = vertical_margin(20) diff --git a/app/views/notification_mailer/send_notification.html.haml b/app/views/notification_mailer/send_notification.html.haml index f1c47e74e..b64553e7a 100644 --- a/app/views/notification_mailer/send_notification.html.haml +++ b/app/views/notification_mailer/send_notification.html.haml @@ -6,7 +6,7 @@ - if @actions.present? = render 'notification_mailer/actions', actions: @actions, dossier: @dossier -- if @with_services_publics_plus +- if @services_publics_plus_url.present? = render 'layouts/mailers/services_publics_plus' - content_for :footer do diff --git a/config/env.example.optional b/config/env.example.optional index 71eb6ad3c..c3924f529 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -163,3 +163,6 @@ DOLIST_LOGIN_URL="https://clientpreprod.dolist.net" SUPPORT_WEBHOOK_URL="" # rappel web de sendinblue SIB_WEBHOOK_URL="" + +# ServicesPublics+ tracking url shown to user when dossier is terminated. +SERVICES_PUBLICS_PLUS_URL=""