943fef3160
Even the one that is mail-specific, because it is too easy to overlook it when refactoring otherwise
24 lines
575 B
Ruby
24 lines
575 B
Ruby
module MailTemplateConcern
|
|
extend ActiveSupport::Concern
|
|
|
|
include TagsSubstitutionConcern
|
|
|
|
def subject_for_dossier(dossier)
|
|
replace_tags(subject, dossier)
|
|
end
|
|
|
|
def body_for_dossier(dossier)
|
|
replace_tags(body, dossier)
|
|
end
|
|
|
|
module ClassMethods
|
|
def default_for_procedure(procedure)
|
|
body = ActionController::Base.new.render_to_string(template: self.const_get(:TEMPLATE_NAME))
|
|
self.new(subject: self.const_get(:DEFAULT_SUBJECT), body: body, procedure: procedure)
|
|
end
|
|
end
|
|
|
|
def dossier_tags
|
|
super + dossier_tags_for_mail
|
|
end
|
|
end
|