2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: sending email wasn't working anymore when a plugin used 'reduce_cooked' (cc @gdpelican)

This commit is contained in:
Régis Hanol 2016-05-21 20:13:00 +02:00
parent feffe23cc5
commit c012b18601
4 changed files with 9 additions and 5 deletions

View file

@ -390,11 +390,11 @@ module PrettyText
doc.css(".lightbox-wrapper .meta").remove
end
def self.format_for_email(html, post = nil, style: nil)
def self.format_for_email(html, post = nil, style = nil)
Email::Styles.new(html, style: style).tap do |doc|
DiscourseEvent.trigger(:reduce_cooked, doc, post)
doc.make_all_links_absolute
doc.send :"format_#{style}" if style
DiscourseEvent.trigger(:reduce_cooked, doc, post)
end.to_html
end