demarches-normaliennes/app/mailers/resend_attestation_mailer.rb
2021-05-26 18:05:14 +02:00

27 lines
678 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,
Lattestation de votre dossier  #{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