Class: DistributionWrappers::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/distribution_wrappers/email/_email.rb

Direct Known Subclasses

Google, Office365, Sendgrid

Instance Attribute Summary

Attributes inherited from Base

#params

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DistributionWrappers::Base

Instance Method Details

#prepare(email) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/distribution_wrappers/email/_email.rb', line 4

def prepare(email)
  @params[:email] = email
  template = Tilt::HamlTemplate.new(File.join(File.dirname(__FILE__), 'template.html.haml'))

  doc = Nokogiri::HTML(@params[:post].draft_content)

  doc = replace_video(doc)

  doc = append_parameters(doc)

  doc = redirect_links(doc)

  @params[:draft_content] = html

  body_html = template.render(@params)

  body_html
end