mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: remove links in poll email notification
This commit is contained in:
parent
8dc8aaaeb0
commit
10270593a4
2 changed files with 9 additions and 3 deletions
|
@ -7,9 +7,10 @@ module Email
|
|||
# Elements to hoist all children out of
|
||||
HTML_HOIST_ELEMENTS = %w(div span font table tbody th tr td)
|
||||
# Node types to always delete
|
||||
HTML_DELETE_ELEMENT_TYPES = [Nokogiri::XML::Node::DTD_NODE,
|
||||
Nokogiri::XML::Node::COMMENT_NODE,
|
||||
]
|
||||
HTML_DELETE_ELEMENT_TYPES = [
|
||||
Nokogiri::XML::Node::DTD_NODE,
|
||||
Nokogiri::XML::Node::COMMENT_NODE,
|
||||
]
|
||||
|
||||
# Private variables:
|
||||
# @doc - nokogiri document
|
||||
|
|
|
@ -14,6 +14,11 @@ VOTES_CUSTOM_FIELD ||= "polls-votes".freeze
|
|||
|
||||
after_initialize do
|
||||
|
||||
# remove "Vote Now!" & "Show Results" links in emails
|
||||
Email::Styles.register_plugin_style do |fragment|
|
||||
fragment.css(".poll a.cast-votes, .poll a.toggle-results").each(&:remove)
|
||||
end
|
||||
|
||||
module ::DiscoursePoll
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name PLUGIN_NAME
|
||||
|
|
Loading…
Reference in a new issue