diff --git a/app/models/channel/email_build.rb b/app/models/channel/email_build.rb index ae8f12959..b01182cbf 100644 --- a/app/models/channel/email_build.rb +++ b/app/models/channel/email_build.rb @@ -152,9 +152,13 @@ Check if string is a complete html document. If not, add head and css styles. return html if html.match?(//i) + html_email_body = File.read('app/views/mailer/application_wrapper.html.erb') + + html_email_body.gsub!('###html_email_css_font###', Setting.get('html_email_css_font')) + # use block form because variable html could contain backslashes and e. g. '\1' that # must not be handled as back-references for regular expressions - Rails.configuration.html_email_body.sub('###html###') { html } + html_email_body.sub('###html###') { html } end =begin diff --git a/app/views/mailer/application_wrapper.html.erb b/app/views/mailer/application_wrapper.html.erb new file mode 100644 index 000000000..34aa0f22a --- /dev/null +++ b/app/views/mailer/application_wrapper.html.erb @@ -0,0 +1,76 @@ + + + + + + + + ###html### + \ No newline at end of file diff --git a/config/initializers/html_email_style.rb b/config/initializers/html_email_style.rb deleted file mode 100644 index ae92feb21..000000000 --- a/config/initializers/html_email_style.rb +++ /dev/null @@ -1,83 +0,0 @@ -if ActiveRecord::Base.connection.table_exists?( Setting.table_name ) - - html_email_css_font = Setting.get('html_email_css_font') - - Rails.application.config.html_email_body = <<~HERE - - - - - - - - ###html### - - HERE -end