demarches-normaliennes/app/models/mails/closed_mail.rb

22 lines
679 B
Ruby
Raw Normal View History

2017-03-06 22:37:37 +01:00
module Mails
class ClosedMail < ApplicationRecord
2017-03-06 22:37:37 +01:00
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
2018-05-30 18:45:46 +02:00
if attestation_template&.activated?
"notification_mailer/default_templates/closed_mail_with_attestation"
else
"notification_mailer/default_templates/closed_mail"
end
end
2017-03-06 22:37:37 +01:00
end
end