[#1563] Allow default template name to depend on procedure

This commit is contained in:
Frederic Merizen 2018-03-16 18:32:43 +01:00
parent 7bf7347b9c
commit db0937d1eb

View file

@ -13,9 +13,14 @@ module MailTemplateConcern
module ClassMethods
def default_for_procedure(procedure)
body = ActionController::Base.new.render_to_string(template: const_get(:DEFAULT_TEMPLATE_NAME))
template_name = default_template_name_for_procedure(procedure)
body = ActionController::Base.new.render_to_string(template: template_name)
new(subject: const_get(:DEFAULT_SUBJECT), body: body, procedure: procedure)
end
def default_template_name_for_procedure(procedure)
const_get(:DEFAULT_TEMPLATE_NAME)
end
end
def dossier_tags