FIX: Set the lang/xml:lang html attrs in emails (#10218)
In some rare cases emails are incorrectly sent out with lang placeholders in body (`xml:lang="%{html_lang}"`)
This commit is contained in:
parent
8e2f57a498
commit
a96ff82e53
|
@ -26,7 +26,10 @@ module EmailHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def email_html_template
|
def email_html_template
|
||||||
EmailStyle.new.html.sub('%{email_content}', capture { yield }).html_safe
|
EmailStyle.new.html
|
||||||
|
.sub('%{email_content}', capture { yield })
|
||||||
|
.gsub('%{html_lang}', html_lang)
|
||||||
|
.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -236,6 +236,14 @@ describe UserNotifications do
|
||||||
expect(html).to include(topic_url)
|
expect(html).to include(topic_url)
|
||||||
expect(text).to include(topic_url)
|
expect(text).to include(topic_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "applies lang/xml:lang html attributes" do
|
||||||
|
SiteSetting.default_locale = "pl_PL"
|
||||||
|
html = subject.html_part.to_s
|
||||||
|
|
||||||
|
expect(html).to match(' lang="pl-PL"')
|
||||||
|
expect(html).to match(' xml:lang="pl-PL"')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue