chore(mailer): setup Services Publics+ by env var so instances can have their owns

This commit is contained in:
Colin Darie 2023-02-07 17:36:14 +01:00
parent d78c75620a
commit 8a859402ad
4 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -7,10 +7,10 @@
%p{ style: 'margin: 0' }
Jaide les services publics à samé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)

View file

@ -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

View file

@ -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=""