FIX: backwards compatibility for uncompiled email style css
This commit is contained in:
parent
40254bae1b
commit
cfe26eb301
|
@ -18,7 +18,7 @@ class EmailStyle
|
|||
end
|
||||
|
||||
def compiled_css
|
||||
SiteSetting.email_custom_css_compiled || self.class.default_css_compiled
|
||||
SiteSetting.email_custom_css_compiled.presence || css
|
||||
end
|
||||
|
||||
def default_html
|
||||
|
@ -38,8 +38,4 @@ class EmailStyle
|
|||
def self.default_css
|
||||
''
|
||||
end
|
||||
|
||||
def self.default_css_compiled
|
||||
''
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,6 +25,12 @@ describe EmailStyle do
|
|||
expect(mail_html).to match("#{Discourse.base_url}/invites/#{invite.invite_key}")
|
||||
end
|
||||
|
||||
it 'applies customizations if compiled is missing' do
|
||||
SiteSetting.remove_override!(:email_custom_css_compiled)
|
||||
expect(mail_html.scan('<h1 style="color: red;">FOR YOU</h1>').count).to eq(1)
|
||||
expect(mail_html).to match("#{Discourse.base_url}/invites/#{invite.invite_key}")
|
||||
end
|
||||
|
||||
it 'can apply RTL attrs' do
|
||||
SiteSetting.default_locale = 'he'
|
||||
body_attrs = mail_html.match(/<body ([^>])+/)
|
||||
|
|
Loading…
Reference in New Issue