Class: MailSpy::Email

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/mail_spy/email.rb

Constant Summary collapse

@@template_cache =
{}

Instance Method Summary collapse

Instance Method Details

#html_erbObject



70
71
72
# File 'app/models/mail_spy/email.rb', line 70

def html_erb
  load_template("html.erb")
end

#parsed_html_contentObject

Great for debugging emails



62
63
64
# File 'app/models/mail_spy/email.rb', line 62

def parsed_html_content
  return MailSpy::CoreMailer.template(self).html_part.body.to_s
end

#parsed_text_contentObject



66
67
68
# File 'app/models/mail_spy/email.rb', line 66

def parsed_text_content
  return MailSpy::CoreMailer.template(self).text_part.body.to_s
end

#template_valuesObject



57
58
59
# File 'app/models/mail_spy/email.rb', line 57

def template_values
  self.read_attribute(:template_values).try(:with_indifferent_access)
end

#text_erbObject



74
75
76
# File 'app/models/mail_spy/email.rb', line 74

def text_erb
  load_template("text.erb")
end