demarches-normaliennes/app/mailers/new_attestation_mailer.rb
2018-09-05 15:46:24 +02:00

31 lines
965 B
Ruby
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class NewAttestationMailer < ApplicationMailer
include Rails.application.routes.url_helpers
def new_attestation(dossier)
to = dossier.user.email
subject = "Nouvelle attestation pour votre dossier nº #{dossier.id}"
mail(to: to, subject: subject, body: body(dossier))
end
private
def body(dossier)
<<~HEREDOC
Bonjour,
Votre dossier  #{dossier.id} (démarche "#{dossier.procedure.libelle}") a subi, à un moment, un "aller-retour" :
- Acceptation de votre dossier
- Passage en instruction du dossier car besoin de le modifier
- Seconde acceptation de votre dossier
Suite à cette opération, l'attestation liée à votre dossier n'a pas é regénérée.
Ce problème est désormais reglé, votre nouvelle attestation est disponible à l'adresse suivante :
#{attestation_dossier_url(dossier)}
Cordialement,
Léquipe demarches-simplifiees.fr
HEREDOC
end
end