demarches-normaliennes/app/models/mails/closed_mail.rb
Pierre de La Morinerie 45abb6ebc2 mailers: move default templates to a specific subdirectory
It makes more understandable that they are templates (and not views
rendered directly by Rails).
2019-07-22 16:22:20 +02:00

21 lines
679 B
Ruby

module Mails
class ClosedMail < ApplicationRecord
include MailTemplateConcern
belongs_to :procedure
SLUG = "closed_mail"
DISPLAYED_NAME = "Accusé d'acceptation"
DEFAULT_SUBJECT = 'Votre dossier nº --numéro du dossier-- a été accepté (--libellé démarche--)'
DOSSIER_STATE = Dossier.states.fetch(:accepte)
def self.default_template_name_for_procedure(procedure)
attestation_template = procedure.attestation_template
if attestation_template&.activated?
"notification_mailer/default_templates/closed_mail_with_attestation"
else
"notification_mailer/default_templates/closed_mail"
end
end
end
end