From 2396ff3355891e279acf7f8da52723b96ee097ee Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 6 Feb 2023 13:00:08 +0100 Subject: [PATCH 1/5] add service plus in notification emails --- app/views/layouts/mailers/_service_plus.html.haml | 3 +++ app/views/notification_mailer/send_notification.html.haml | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 app/views/layouts/mailers/_service_plus.html.haml diff --git a/app/views/layouts/mailers/_service_plus.html.haml b/app/views/layouts/mailers/_service_plus.html.haml new file mode 100644 index 000000000..0dd34de33 --- /dev/null +++ b/app/views/layouts/mailers/_service_plus.html.haml @@ -0,0 +1,3 @@ +%p{ style: 'background-color: #F5F5FE; padding: 25px; ' } + J'aide les services publics à s'améliorer : + = 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' diff --git a/app/views/notification_mailer/send_notification.html.haml b/app/views/notification_mailer/send_notification.html.haml index 6ce7aa565..f8b956106 100644 --- a/app/views/notification_mailer/send_notification.html.haml +++ b/app/views/notification_mailer/send_notification.html.haml @@ -6,5 +6,7 @@ - if @actions.present? = render 'notification_mailer/actions', actions: @actions, dossier: @dossier += render 'layouts/mailers/service_plus' + - content_for :footer do = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier From dfb1863d92c1322fa024aa2d7d936b555edc856d Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 6 Feb 2023 15:44:51 +0100 Subject: [PATCH 2/5] add logo service plus --- .../images/mailer/logo-services-plus.svg | 23 +++++++++++++++++++ .../layouts/mailers/_service_plus.html.haml | 13 ++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 app/assets/images/mailer/logo-services-plus.svg diff --git a/app/assets/images/mailer/logo-services-plus.svg b/app/assets/images/mailer/logo-services-plus.svg new file mode 100644 index 000000000..1ef6a7f1d --- /dev/null +++ b/app/assets/images/mailer/logo-services-plus.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/views/layouts/mailers/_service_plus.html.haml b/app/views/layouts/mailers/_service_plus.html.haml index 0dd34de33..e514c8d12 100644 --- a/app/views/layouts/mailers/_service_plus.html.haml +++ b/app/views/layouts/mailers/_service_plus.html.haml @@ -1,3 +1,10 @@ -%p{ style: 'background-color: #F5F5FE; padding: 25px; ' } - J'aide les services publics à s'améliorer : - = 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' +%div{ style: 'background-color: #F5F5FE; padding: 15px;' } + %table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0" } + %tr + %td{ width: "25%" } + = image_tag('mailer/logo-services-plus.svg', "aria-hidden": true, style: 'vertical-align: middle') + %td{ width: "75%", valign: "top" } + %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' From 82ad6346ccd4a07c83d9b23ea2f9208ff342c315 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 7 Feb 2023 13:36:53 +0100 Subject: [PATCH 3/5] chore(service-plus): replace svg by png, micro improve layout for clients compat --- .../images/mailer/logo-services-plus.png | Bin 0 -> 1930 bytes .../images/mailer/logo-services-plus.svg | 23 ------------------ .../layouts/mailers/_service_plus.html.haml | 18 +++++++++----- 3 files changed, 12 insertions(+), 29 deletions(-) create mode 100644 app/assets/images/mailer/logo-services-plus.png delete mode 100644 app/assets/images/mailer/logo-services-plus.svg diff --git a/app/assets/images/mailer/logo-services-plus.png b/app/assets/images/mailer/logo-services-plus.png new file mode 100644 index 0000000000000000000000000000000000000000..975605679333dc22c8be2fb881c42556f415644e GIT binary patch literal 1930 zcmV;52X**~P)F}Rlnu< zKQzv8etv#_etv#_etv#!FcC+v17Dy5?C!@f2e-g1fH8_6(H&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ztn|r@ezO z4z8h&c_v0a!+g@SXYk;&0}|bAc{Lmh!z=rTbDZz|AKB-R?DI$V`6K)O2U;wrfVB0Q Qw*UYD07*qoM6N<$f&r9n=l}o! literal 0 HcmV?d00001 diff --git a/app/assets/images/mailer/logo-services-plus.svg b/app/assets/images/mailer/logo-services-plus.svg deleted file mode 100644 index 1ef6a7f1d..000000000 --- a/app/assets/images/mailer/logo-services-plus.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/views/layouts/mailers/_service_plus.html.haml b/app/views/layouts/mailers/_service_plus.html.haml index e514c8d12..4370da79f 100644 --- a/app/views/layouts/mailers/_service_plus.html.haml +++ b/app/views/layouts/mailers/_service_plus.html.haml @@ -1,10 +1,16 @@ -%div{ style: 'background-color: #F5F5FE; padding: 15px;' } += vertical_margin(20) + +%div{ style: 'background-color: #F5F5FE; padding: 20px;' } %table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0" } %tr - %td{ width: "25%" } - = image_tag('mailer/logo-services-plus.svg', "aria-hidden": true, style: 'vertical-align: middle') - %td{ width: "75%", valign: "top" } + %td{ width: "70%", valign: "top", align: "center" } %p{ style: 'margin: 0' } - J'aide les services publics à s'améliorer : + 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' + = 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' + + %td{ width: "30%" } + = link_to 'https://www.plus.transformation.gouv.fr/experience/step_1?pk_campaign=demarches-simplifiees', 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) From d78c75620aa52d6631311068e60dd0dde2a0760e Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 7 Feb 2023 17:27:25 +0100 Subject: [PATCH 4/5] chore(mailer): services publics + only for Termine "states" --- app/mailers/notification_mailer.rb | 7 +++++++ ...ice_plus.html.haml => _services_publics_plus.html.haml} | 0 app/views/notification_mailer/send_notification.html.haml | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) rename app/views/layouts/mailers/{_service_plus.html.haml => _services_publics_plus.html.haml} (100%) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 2d4e36e0e..3780e939d 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -9,6 +9,7 @@ class NotificationMailer < ApplicationMailer include ActionView::Helpers::SanitizeHelper before_action :set_dossier + before_action :set_services_publics_plus, only: :send_notification after_action :create_commentaire_for_notification helper ServiceHelper @@ -50,6 +51,12 @@ class NotificationMailer < ApplicationMailer private + def set_services_publics_plus + return unless Dossier::TERMINE.include?(params[:state]) + + @with_services_publics_plus = true + end + def set_dossier @dossier = params[:dossier] diff --git a/app/views/layouts/mailers/_service_plus.html.haml b/app/views/layouts/mailers/_services_publics_plus.html.haml similarity index 100% rename from app/views/layouts/mailers/_service_plus.html.haml rename to app/views/layouts/mailers/_services_publics_plus.html.haml diff --git a/app/views/notification_mailer/send_notification.html.haml b/app/views/notification_mailer/send_notification.html.haml index f8b956106..f1c47e74e 100644 --- a/app/views/notification_mailer/send_notification.html.haml +++ b/app/views/notification_mailer/send_notification.html.haml @@ -6,7 +6,8 @@ - if @actions.present? = render 'notification_mailer/actions', actions: @actions, dossier: @dossier -= render 'layouts/mailers/service_plus' +- if @with_services_publics_plus + = render 'layouts/mailers/services_publics_plus' - content_for :footer do = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier From 8a859402ad8039dfc299164faa6065eaf637d0d4 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 7 Feb 2023 17:36:14 +0100 Subject: [PATCH 5/5] 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=""