Module: Thredded::EmailTransformer

Defined in:
lib/thredded/email_transformer.rb,
lib/thredded/email_transformer/base.rb,
lib/thredded/email_transformer/onebox.rb,
lib/thredded/email_transformer/spoiler.rb

Overview

This transformer should applied to emails so that they render correctly in the email clients.

For example, if you use roadie, you can configure it to use the transformer in the initializer:

# config/initializers/roadie.rb
Rails.application.config.roadie.before_transformation = Thredded::EmailTransformer

Defined Under Namespace

Modules: Helpers Classes: Base, Onebox, Spoiler

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.transformersObject

Returns the value of attribute transformers


16
17
18
# File 'lib/thredded/email_transformer.rb', line 16

def transformers
  @transformers
end

Class Method Details

.call(doc) ⇒ Object

Parameters:

  • doc (Nokogiri::HTML::Document)

21
22
23
# File 'lib/thredded/email_transformer.rb', line 21

def self.call(doc)
  transformers.each { |transformer| transformer.call(doc) }
end