mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: replace polls with a link in emails
This commit is contained in:
@@ -68,7 +68,7 @@ module Email
|
||||
html_override.gsub!("%{unsubscribe_link}", unsubscribe_link)
|
||||
end
|
||||
|
||||
styled = Email::Styles.new(html_override)
|
||||
styled = Email::Styles.new(html_override, @opts)
|
||||
styled.format_basic
|
||||
|
||||
if style = @opts[:style]
|
||||
|
||||
@@ -16,11 +16,11 @@ module Email
|
||||
|
||||
def html
|
||||
if @message.html_part
|
||||
style = Email::Styles.new(@message.html_part.body.to_s)
|
||||
style = Email::Styles.new(@message.html_part.body.to_s, @opts)
|
||||
style.format_basic
|
||||
style.format_html
|
||||
else
|
||||
style = Email::Styles.new(PrettyText.cook(text))
|
||||
style = Email::Styles.new(PrettyText.cook(text), @opts)
|
||||
style.format_basic
|
||||
end
|
||||
|
||||
|
||||
+3
-2
@@ -6,8 +6,9 @@ module Email
|
||||
class Styles
|
||||
@@plugin_callbacks = []
|
||||
|
||||
def initialize(html)
|
||||
def initialize(html, opts=nil)
|
||||
@html = html
|
||||
@opts = opts || {}
|
||||
@fragment = Nokogiri::HTML.fragment(@html)
|
||||
end
|
||||
|
||||
@@ -146,7 +147,7 @@ module Email
|
||||
|
||||
# this method is reserved for styles specific to plugin
|
||||
def plugin_styles
|
||||
@@plugin_callbacks.each { |block| block.call(@fragment) }
|
||||
@@plugin_callbacks.each { |block| block.call(@fragment, @opts) }
|
||||
end
|
||||
|
||||
def to_html
|
||||
|
||||
Reference in New Issue
Block a user