diff --git a/app/models/concerns/mail_template_concern.rb b/app/models/concerns/mail_template_concern.rb index fb113d945..458537d4c 100644 --- a/app/models/concerns/mail_template_concern.rb +++ b/app/models/concerns/mail_template_concern.rb @@ -34,6 +34,10 @@ module MailTemplateConcern replace_tags(body, dossier) end + def tags + self.class.const_get(:ALLOWED_TAGS) + end + def replace_tags(string, dossier) TAGS.inject(string) do |acc, tag| acc.gsub("--#{tag[:libelle]}--", replace_tag(tag, dossier)) || acc diff --git a/app/views/admin/mail_templates/edit.html.haml b/app/views/admin/mail_templates/edit.html.haml index 6b99200ca..0e5718ce9 100644 --- a/app/views/admin/mail_templates/edit.html.haml +++ b/app/views/admin/mail_templates/edit.html.haml @@ -22,7 +22,7 @@ Balise %th Description - - @mail_template.class.const_get(:ALLOWED_TAGS).each do |tag| + - @mail_template.tags.each do |tag| %tr %td.center = "--#{tag[:libelle]}--"