diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 56802bb30..6ada3e2e4 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -39,6 +39,7 @@ class UserNotifications < ActionMailer::Base @site_name = SiteSetting.title + @header_color = ColorScheme.hex_for_name('header_background') @last_seen_at = I18n.l(@user.last_seen_at || @user.created_at, format: :short) # A list of topics to show the user diff --git a/app/models/color_scheme.rb b/app/models/color_scheme.rb index a4fe017e4..c63e8862f 100644 --- a/app/models/color_scheme.rb +++ b/app/models/color_scheme.rb @@ -60,6 +60,10 @@ class ColorScheme < ActiveRecord::Base new_color_scheme end + def self.hex_for_name(name) + # Can't use `where` here because base doesn't allow it + (enabled || base).colors.find {|c| c.name == name }.try(:hex) + end def colors=(arr) @colors_by_name = nil diff --git a/app/views/user_notifications/digest.html.erb b/app/views/user_notifications/digest.html.erb index e35fc1db9..b2b47eda2 100644 --- a/app/views/user_notifications/digest.html.erb +++ b/app/views/user_notifications/digest.html.erb @@ -1,6 +1,6 @@