FIX: remove links in poll email notification

This commit is contained in:
Régis Hanol 2015-04-26 00:37:27 +02:00
parent 8dc8aaaeb0
commit 10270593a4
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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