demarches-normaliennes/app/mailers/resend_attestation_mailer.rb

31 lines
762 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_for(:notification)
subject = "Nouvelle attestation pour votre dossier nº #{dossier.id}"
mail(to: to, subject: subject, body: body(dossier))
end
def self.critical_email?(action_name)
false
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 #{Current.application_name}
HEREDOC
end
end