commit
0da03dac1e
9 changed files with 28 additions and 40 deletions
|
@ -5,7 +5,7 @@ class AdministrateurMailer < ApplicationMailer
|
|||
@administrateur = administrateur
|
||||
@reset_password_token = reset_password_token
|
||||
@expiration_date = @administrateur.reset_password_sent_at + Devise.reset_password_within
|
||||
subject = "demarches-simplifiees.fr - N'oubliez pas d'activer votre compte administrateur"
|
||||
subject = "N'oubliez pas d'activer votre compte administrateur"
|
||||
|
||||
mail(to: administrateur.email,
|
||||
subject: subject,
|
||||
|
|
|
@ -4,7 +4,7 @@ class AdministrationMailer < ApplicationMailer
|
|||
def new_admin_email(admin, administration)
|
||||
@admin = admin
|
||||
@administration = administration
|
||||
subject = "Création d'un compte Admin demarches-simplifiees.fr"
|
||||
subject = "Création d'un compte admininistrateur"
|
||||
|
||||
mail(to: TECH_EMAIL,
|
||||
subject: subject)
|
||||
|
@ -13,7 +13,7 @@ class AdministrationMailer < ApplicationMailer
|
|||
def invite_admin(admin, reset_password_token)
|
||||
@reset_password_token = reset_password_token
|
||||
@admin = admin
|
||||
subject = "demarches-simplifiees.fr - Activez votre compte administrateur"
|
||||
subject = "Activez votre compte administrateur"
|
||||
|
||||
mail(to: admin.email,
|
||||
subject: subject,
|
||||
|
@ -21,7 +21,7 @@ class AdministrationMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def refuse_admin(admin_email)
|
||||
subject = "demarches-simplifiees.fr - Votre demande de compte a été refusée"
|
||||
subject = "Votre demande de compte a été refusée"
|
||||
|
||||
mail(to: admin_email,
|
||||
subject: subject,
|
||||
|
|
|
@ -4,7 +4,7 @@ class GestionnaireMailer < ApplicationMailer
|
|||
def invite_gestionnaire(gestionnaire, reset_password_token)
|
||||
@reset_password_token = reset_password_token
|
||||
@gestionnaire = gestionnaire
|
||||
subject = "demarches-simplifiees.fr - Activez votre compte accompagnateur"
|
||||
subject = "Activez votre compte accompagnateur"
|
||||
|
||||
mail(to: gestionnaire.email,
|
||||
subject: subject,
|
||||
|
@ -12,17 +12,19 @@ class GestionnaireMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def user_to_gestionnaire(email)
|
||||
subject = "Vous avez été nommé accompagnateur sur demarches-simplifiees.fr"
|
||||
@email = email
|
||||
subject = "Vous avez été nommé accompagnateur"
|
||||
|
||||
send_mail(email, nil, subject)
|
||||
mail(to: @email, subject: subject)
|
||||
end
|
||||
|
||||
def last_week_overview(gestionnaire)
|
||||
email = gestionnaire.email
|
||||
@overview = gestionnaire.last_week_overview
|
||||
headers['X-mailjet-campaign'] = 'last_week_overview'
|
||||
overview = gestionnaire.last_week_overview
|
||||
subject = 'Vos activités sur demarches-simplifiees.fr'
|
||||
subject = 'Votre activité hebdomadaire'
|
||||
|
||||
send_mail(gestionnaire.email, overview, subject)
|
||||
mail(to: email, subject: subject)
|
||||
end
|
||||
|
||||
def send_dossier(sender, dossier, recipient)
|
||||
|
@ -32,17 +34,4 @@ class GestionnaireMailer < ApplicationMailer
|
|||
|
||||
mail(to: recipient.email, subject: subject)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def vars_mailer(email, args)
|
||||
@args = args
|
||||
@email = email
|
||||
end
|
||||
|
||||
def send_mail(email, args, subject)
|
||||
vars_mailer email, args
|
||||
|
||||
mail(to: email, subject: subject)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
class InviteMailer < ApplicationMailer
|
||||
def invite_user(invite)
|
||||
vars_mailer(invite)
|
||||
subject = "demarches-simplifiees.fr - Participez à l'élaboration d'un dossier"
|
||||
subject = "Participez à l'élaboration d'un dossier"
|
||||
|
||||
send_mail(invite.email, subject, invite.email_sender) if invite.user.present?
|
||||
if invite.user.present?
|
||||
send_mail(invite, subject, invite.email_sender)
|
||||
end
|
||||
end
|
||||
|
||||
def invite_guest(invite)
|
||||
vars_mailer(invite)
|
||||
subject = "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur demarches-simplifiees.fr"
|
||||
subject = "#{invite.email_sender} vous invite à consulter un dossier"
|
||||
|
||||
send_mail(invite.email, subject, invite.email_sender)
|
||||
send_mail(invite, subject, invite.email_sender)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def vars_mailer(invite)
|
||||
def send_mail(invite, subject, reply_to)
|
||||
@invite = invite
|
||||
end
|
||||
email = invite.email
|
||||
|
||||
def send_mail(email, subject, reply_to)
|
||||
mail(to: email,
|
||||
subject: subject,
|
||||
reply_to: reply_to)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
class NotificationMailer < ApplicationMailer
|
||||
def new_answer(dossier)
|
||||
subject = "Nouveau message pour votre dossier demarches-simplifiees.fr nº #{dossier.id}"
|
||||
subject = "Nouveau message pour votre dossier nº #{dossier.id}"
|
||||
|
||||
send_mail(dossier, subject)
|
||||
end
|
||||
|
||||
def send_draft_notification(dossier)
|
||||
subject = "Retrouvez votre brouillon pour la démarche : #{dossier.procedure.libelle}"
|
||||
subject = "Retrouvez votre brouillon pour la démarche \"#{dossier.procedure.libelle}\""
|
||||
|
||||
send_mail(dossier, subject)
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:title, 'Vos activités sur demarches-simplifiees.fr')
|
||||
- content_for(:title, 'Votre activité hebdomadaire')
|
||||
|
||||
- @args[:procedure_overviews].each_with_index do |procedure_overview, index|
|
||||
- @overview[:procedure_overviews].each_with_index do |procedure_overview, index|
|
||||
|
||||
%h2{ style: 'font-size: 20px; font-weight: 300; margin: 25px 0 5px;' }
|
||||
#{procedure_overview.procedure.libelle}
|
||||
|
@ -42,5 +42,5 @@
|
|||
- end.join(', ')
|
||||
= sanitize(old_dossiers_en_instruction, attributes: %w(href style))
|
||||
|
||||
- if index != (@args[:procedure_overviews].count - 1)
|
||||
- if index != (@overview[:procedure_overviews].count - 1)
|
||||
.spacer{ style: 'border-bottom: 1px solid #CCC; margin: 25px 0 30px;' }
|
||||
|
|
|
@ -34,6 +34,6 @@ RSpec.describe GestionnaireMailer, type: :mailer do
|
|||
|
||||
subject { described_class.last_week_overview(gestionnaire) }
|
||||
|
||||
it { expect(subject.body).to include('Vos activités') }
|
||||
it { expect(subject.body).to include('Votre activité hebdomadaire') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -58,6 +58,6 @@ RSpec.describe NotificationMailer, type: :mailer do
|
|||
|
||||
it { expect(subject.body).to match('Un nouveau message est disponible dans votre espace demarches-simplifiees.fr.') }
|
||||
it { expect(subject.body).to include("Pour le consulter, merci de vous rendre sur #{users_dossier_recapitulatif_url(dossier_id: dossier.id)}") }
|
||||
it { expect(subject.subject).to eq("Nouveau message pour votre dossier demarches-simplifiees.fr nº #{dossier.id}") }
|
||||
it { expect(subject.subject).to eq("Nouveau message pour votre dossier nº #{dossier.id}") }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -591,7 +591,7 @@ describe Dossier do
|
|||
end.to change(ActionMailer::Base.deliveries, :size).from(0).to(1)
|
||||
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
expect(mail.subject).to eq("Retrouvez votre brouillon pour la démarche : #{procedure.libelle}")
|
||||
expect(mail.subject).to eq("Retrouvez votre brouillon pour la démarche \"#{procedure.libelle}\"")
|
||||
end
|
||||
|
||||
it "does not send an email when the dossier is created with a non brouillon state" do
|
||||
|
|
Loading…
Reference in a new issue