demarches-normaliennes/app/mailers/resend_attestation_mailer.rb
2020-07-23 16:17:52 +02:00

27 lines
676 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 ResendAttestationMailer < ApplicationMailer
include Rails.application.routes.url_helpers
def resend_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,
L'attestation de votre dossier nº #{dossier.id} (démarche "#{dossier.procedure.libelle}") a été modifiée.
Votre nouvelle attestation est disponible à l'adresse suivante :
#{attestation_dossier_url(dossier)}
Cordialement,
Léquipe #{APPLICATION_NAME}
HEREDOC
end
end