From 8f1579fb9e7461fbd4df07e8cb9e716c8e0b3e17 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 31 May 2018 16:03:06 +0200 Subject: [PATCH 1/2] [Fix #886] Move mail templates from /mails to /notification_mailers --- app/models/mails/closed_mail.rb | 4 ++-- app/models/mails/initiated_mail.rb | 2 +- app/models/mails/received_mail.rb | 2 +- app/models/mails/refused_mail.rb | 2 +- app/models/mails/without_continuation_mail.rb | 2 +- .../{mails => notification_mailer}/closed_mail.html.haml | 0 .../closed_mail_with_attestation.html.haml | 0 .../{mails => notification_mailer}/initiated_mail.html.haml | 0 .../{mails => notification_mailer}/received_mail.html.haml | 0 .../{mails => notification_mailer}/refused_mail.html.haml | 0 .../without_continuation_mail.html.haml | 0 11 files changed, 6 insertions(+), 6 deletions(-) rename app/views/{mails => notification_mailer}/closed_mail.html.haml (100%) rename app/views/{mails => notification_mailer}/closed_mail_with_attestation.html.haml (100%) rename app/views/{mails => notification_mailer}/initiated_mail.html.haml (100%) rename app/views/{mails => notification_mailer}/received_mail.html.haml (100%) rename app/views/{mails => notification_mailer}/refused_mail.html.haml (100%) rename app/views/{mails => notification_mailer}/without_continuation_mail.html.haml (100%) diff --git a/app/models/mails/closed_mail.rb b/app/models/mails/closed_mail.rb index a52b9e515..06449ac2c 100644 --- a/app/models/mails/closed_mail.rb +++ b/app/models/mails/closed_mail.rb @@ -12,9 +12,9 @@ module Mails def self.default_template_name_for_procedure(procedure) attestation_template = procedure.attestation_template if attestation_template&.activated? - "mails/closed_mail_with_attestation" + "notification_mailer/closed_mail_with_attestation" else - "mails/closed_mail" + "notification_mailer/closed_mail" end end end diff --git a/app/models/mails/initiated_mail.rb b/app/models/mails/initiated_mail.rb index 0bcac1da0..fda082018 100644 --- a/app/models/mails/initiated_mail.rb +++ b/app/models/mails/initiated_mail.rb @@ -5,7 +5,7 @@ module Mails belongs_to :procedure SLUG = "initiated_mail" - DEFAULT_TEMPLATE_NAME = "mails/initiated_mail" + DEFAULT_TEMPLATE_NAME = "notification_mailer/initiated_mail" DISPLAYED_NAME = 'Accusé de réception' DEFAULT_SUBJECT = 'Votre dossier demarches-simplifiees.fr nº --numéro du dossier-- a bien été reçu' DOSSIER_STATE = 'en_construction' diff --git a/app/models/mails/received_mail.rb b/app/models/mails/received_mail.rb index ca6163cbf..573e0e603 100644 --- a/app/models/mails/received_mail.rb +++ b/app/models/mails/received_mail.rb @@ -5,7 +5,7 @@ module Mails belongs_to :procedure SLUG = "received_mail" - DEFAULT_TEMPLATE_NAME = "mails/received_mail" + DEFAULT_TEMPLATE_NAME = "notification_mailer/received_mail" DISPLAYED_NAME = 'Accusé de passage en instruction' DEFAULT_SUBJECT = 'Votre dossier demarches-simplifiees.fr nº --numéro du dossier-- va être instruit' DOSSIER_STATE = 'en_instruction' diff --git a/app/models/mails/refused_mail.rb b/app/models/mails/refused_mail.rb index aef42ee89..6e115d7b6 100644 --- a/app/models/mails/refused_mail.rb +++ b/app/models/mails/refused_mail.rb @@ -5,7 +5,7 @@ module Mails belongs_to :procedure SLUG = "refused_mail" - DEFAULT_TEMPLATE_NAME = "mails/refused_mail" + DEFAULT_TEMPLATE_NAME = "notification_mailer/refused_mail" DISPLAYED_NAME = 'Accusé de rejet du dossier' DEFAULT_SUBJECT = 'Votre dossier demarches-simplifiees.fr nº --numéro du dossier-- a été refusé' DOSSIER_STATE = 'refuse' diff --git a/app/models/mails/without_continuation_mail.rb b/app/models/mails/without_continuation_mail.rb index c7768d131..9eea33ff1 100644 --- a/app/models/mails/without_continuation_mail.rb +++ b/app/models/mails/without_continuation_mail.rb @@ -5,7 +5,7 @@ module Mails belongs_to :procedure SLUG = "without_continuation" - DEFAULT_TEMPLATE_NAME = "mails/without_continuation_mail" + DEFAULT_TEMPLATE_NAME = "notification_mailer/without_continuation_mail" DISPLAYED_NAME = 'Accusé de classement sans suite' DEFAULT_SUBJECT = 'Votre dossier demarches-simplifiees.fr nº --numéro du dossier-- a été classé sans suite' DOSSIER_STATE = 'sans_suite' diff --git a/app/views/mails/closed_mail.html.haml b/app/views/notification_mailer/closed_mail.html.haml similarity index 100% rename from app/views/mails/closed_mail.html.haml rename to app/views/notification_mailer/closed_mail.html.haml diff --git a/app/views/mails/closed_mail_with_attestation.html.haml b/app/views/notification_mailer/closed_mail_with_attestation.html.haml similarity index 100% rename from app/views/mails/closed_mail_with_attestation.html.haml rename to app/views/notification_mailer/closed_mail_with_attestation.html.haml diff --git a/app/views/mails/initiated_mail.html.haml b/app/views/notification_mailer/initiated_mail.html.haml similarity index 100% rename from app/views/mails/initiated_mail.html.haml rename to app/views/notification_mailer/initiated_mail.html.haml diff --git a/app/views/mails/received_mail.html.haml b/app/views/notification_mailer/received_mail.html.haml similarity index 100% rename from app/views/mails/received_mail.html.haml rename to app/views/notification_mailer/received_mail.html.haml diff --git a/app/views/mails/refused_mail.html.haml b/app/views/notification_mailer/refused_mail.html.haml similarity index 100% rename from app/views/mails/refused_mail.html.haml rename to app/views/notification_mailer/refused_mail.html.haml diff --git a/app/views/mails/without_continuation_mail.html.haml b/app/views/notification_mailer/without_continuation_mail.html.haml similarity index 100% rename from app/views/mails/without_continuation_mail.html.haml rename to app/views/notification_mailer/without_continuation_mail.html.haml From a0b82696ddabed75d5032880c0f72f978ad746b6 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 31 May 2018 16:12:14 +0200 Subject: [PATCH 2/2] [Fix #886] devise/mailer -> devise_mailer --- app/mailers/devise_user_mailer.rb | 2 +- .../confirmation_instructions.html.haml | 0 .../reset_password_instructions.html.erb | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename app/views/{devise/mailer => devise_mailer}/confirmation_instructions.html.haml (100%) rename app/views/{devise/mailer => devise_mailer}/reset_password_instructions.html.erb (100%) diff --git a/app/mailers/devise_user_mailer.rb b/app/mailers/devise_user_mailer.rb index 8141a48a0..ad280ed8b 100644 --- a/app/mailers/devise_user_mailer.rb +++ b/app/mailers/devise_user_mailer.rb @@ -1,6 +1,6 @@ class DeviseUserMailer < Devise::Mailer helper :application # gives access to all helpers defined within `application_helper`. include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url` - default template_path: 'devise/mailer' # to make sure that your mailer uses the devise views + default template_path: 'devise_mailer' # to make sure that your mailer uses the devise views layout 'mailers/layout' end diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise_mailer/confirmation_instructions.html.haml similarity index 100% rename from app/views/devise/mailer/confirmation_instructions.html.haml rename to app/views/devise_mailer/confirmation_instructions.html.haml diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise_mailer/reset_password_instructions.html.erb similarity index 100% rename from app/views/devise/mailer/reset_password_instructions.html.erb rename to app/views/devise_mailer/reset_password_instructions.html.erb