From a5f9be00e00f6f734d4d9e6f3cdc9f1edf250387 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 20 Nov 2018 10:57:51 +0000 Subject: [PATCH] mailers: add preview URL to all previewable mailers --- app/mailers/administrateur_mailer.rb | 1 + app/mailers/administration_mailer.rb | 1 + app/mailers/avis_mailer.rb | 1 + app/mailers/devise_user_mailer.rb | 1 + app/mailers/dossier_mailer.rb | 1 + app/mailers/gestionnaire_mailer.rb | 1 + app/mailers/invite_mailer.rb | 1 + app/mailers/new_attestation_mailer.rb | 1 + app/mailers/notification_mailer.rb | 3 +++ app/mailers/user_mailer.rb | 1 + spec/mailers/previews/user_mailer_preview.rb | 2 +- 11 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/mailers/administrateur_mailer.rb b/app/mailers/administrateur_mailer.rb index b31ab2633..55855db14 100644 --- a/app/mailers/administrateur_mailer.rb +++ b/app/mailers/administrateur_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/administrateur_mailer class AdministrateurMailer < ApplicationMailer layout 'mailers/layout' diff --git a/app/mailers/administration_mailer.rb b/app/mailers/administration_mailer.rb index 36bb5d477..fde506f40 100644 --- a/app/mailers/administration_mailer.rb +++ b/app/mailers/administration_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/administration_mailer class AdministrationMailer < ApplicationMailer layout 'mailers/layout' diff --git a/app/mailers/avis_mailer.rb b/app/mailers/avis_mailer.rb index 2580f4be6..b4ca982c1 100644 --- a/app/mailers/avis_mailer.rb +++ b/app/mailers/avis_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/avis_mailer class AvisMailer < ApplicationMailer def avis_invitation(avis) @avis = avis diff --git a/app/mailers/devise_user_mailer.rb b/app/mailers/devise_user_mailer.rb index faea78ec5..030c528c9 100644 --- a/app/mailers/devise_user_mailer.rb +++ b/app/mailers/devise_user_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/devise_user_mailer class DeviseUserMailer < Devise::Mailer helper :application # gives access to all helpers defined within `application_helper`. include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url` diff --git a/app/mailers/dossier_mailer.rb b/app/mailers/dossier_mailer.rb index f9b27e3de..a00e31d8e 100644 --- a/app/mailers/dossier_mailer.rb +++ b/app/mailers/dossier_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/dossier_mailer class DossierMailer < ApplicationMailer layout 'mailers/layout' diff --git a/app/mailers/gestionnaire_mailer.rb b/app/mailers/gestionnaire_mailer.rb index a3473f65f..09f7af238 100644 --- a/app/mailers/gestionnaire_mailer.rb +++ b/app/mailers/gestionnaire_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/gestionnaire_mailer class GestionnaireMailer < ApplicationMailer layout 'mailers/layout' diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index 0cf3752cb..7d0be51e6 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/invite_mailer class InviteMailer < ApplicationMailer def invite_user(invite) subject = "Participez à l'élaboration d'un dossier" diff --git a/app/mailers/new_attestation_mailer.rb b/app/mailers/new_attestation_mailer.rb index d8531cffe..b6ea9b78c 100644 --- a/app/mailers/new_attestation_mailer.rb +++ b/app/mailers/new_attestation_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/new_attestation_mailer class NewAttestationMailer < ApplicationMailer include Rails.application.routes.url_helpers diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index d3f9252a9..503bd4bf0 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -1,7 +1,10 @@ +# Preview all emails at http://localhost:3000/rails/mailers/notification_mailer + # A Notification is attached as a Comment to the relevant discussion, # then sent by email to the user. # # The subject and body of a Notification can be customized by each demarche. +# class NotificationMailer < ApplicationMailer def send_dossier_received(dossier) send_notification(dossier, dossier.procedure.received_mail_template) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index f4cdab83d..2304d41fd 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,3 +1,4 @@ +# Preview all emails at http://localhost:3000/rails/mailers/user_mailer class UserMailer < ApplicationMailer layout 'mailers/layout' diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb index 001799662..d2dfa3e70 100644 --- a/spec/mailers/previews/user_mailer_preview.rb +++ b/spec/mailers/previews/user_mailer_preview.rb @@ -1,4 +1,4 @@ -class UserPreview < ActionMailer::Preview +class UserMailerPreview < ActionMailer::Preview def new_account_warning UserMailer.new_account_warning(User.first) end