2017-03-06 22:37:37 +01:00
|
|
|
|
module Mails
|
2017-05-27 00:44:01 +02:00
|
|
|
|
class ClosedMail < ApplicationRecord
|
2017-03-06 22:37:37 +01:00
|
|
|
|
include MailTemplateConcern
|
|
|
|
|
|
2017-12-22 21:37:08 +01:00
|
|
|
|
belongs_to :procedure
|
|
|
|
|
|
2017-05-27 00:52:32 +02:00
|
|
|
|
SLUG = "closed_mail"
|
2017-03-06 23:18:16 +01:00
|
|
|
|
DISPLAYED_NAME = "Accusé d'acceptation"
|
2018-02-28 16:01:20 +01:00
|
|
|
|
DEFAULT_SUBJECT = 'Votre dossier demarches-simplifiees.fr nº --numéro du dossier-- a été accepté'
|
2018-01-10 15:03:56 +01:00
|
|
|
|
DOSSIER_STATE = 'accepte'
|
2018-03-16 19:39:48 +01:00
|
|
|
|
|
|
|
|
|
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?
|
2018-05-31 16:03:06 +02:00
|
|
|
|
"notification_mailer/closed_mail_with_attestation"
|
2018-03-16 19:39:48 +01:00
|
|
|
|
else
|
2018-05-31 16:03:06 +02:00
|
|
|
|
"notification_mailer/closed_mail"
|
2018-03-16 19:39:48 +01:00
|
|
|
|
end
|
|
|
|
|
end
|
2017-03-06 22:37:37 +01:00
|
|
|
|
end
|
|
|
|
|
end
|