diff --git a/config/initializers/html_email_style.rb b/config/initializers/html_email_style.rb index 8561d3a7e..ae92feb21 100644 --- a/config/initializers/html_email_style.rb +++ b/config/initializers/html_email_style.rb @@ -1,81 +1,83 @@ +if ActiveRecord::Base.connection.table_exists?( Setting.table_name ) -Rails.application.config.html_email_css_font = "font-family:'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; font-size: 12px;" + html_email_css_font = Setting.get('html_email_css_font') -Rails.application.config.html_email_body = <<~HERE - - -
- - - - - ###html### - -HERE + Rails.application.config.html_email_body = <<~HERE + + + + + + + + ###html### + + HERE +end diff --git a/db/migrate/20180306084119_custom_html_email_css_font.rb b/db/migrate/20180306084119_custom_html_email_css_font.rb new file mode 100644 index 000000000..a6f3dd1ad --- /dev/null +++ b/db/migrate/20180306084119_custom_html_email_css_font.rb @@ -0,0 +1,21 @@ +class CustomHtmlEmailCssFont < ActiveRecord::Migration[5.1] + def change + + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + + Setting.create_if_not_exists( + title: 'HTML Email CSS Font', + name: 'html_email_css_font', + area: 'Core', + description: 'Defines the CSS font information for HTML Emails.', + options: {}, + state: "font-family:'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; font-size: 12px;", + preferences: { + permission: ['admin'], + }, + frontend: false + ) + + end +end diff --git a/db/seeds/settings.rb b/db/seeds/settings.rb index c0c8458e2..5fdbc33fb 100644 --- a/db/seeds/settings.rb +++ b/db/seeds/settings.rb @@ -3739,3 +3739,16 @@ Setting.create_if_not_exists( preferences: { online_service_disable: true }, frontend: false ) + +Setting.create_if_not_exists( + title: 'HTML Email CSS Font', + name: 'html_email_css_font', + area: 'Core', + description: 'Defines the CSS font information for HTML Emails.', + options: {}, + state: "font-family:'Helvetica Neue', Helvetica, Arial, Geneva, sans-serif; font-size: 12px;", + preferences: { + permission: ['admin'], + }, + frontend: false +)