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