Class: AlleJest::Emailer
- Inherits:
-
Object
- Object
- AlleJest::Emailer
- Includes:
- HasAttributes
- Defined in:
- lib/allejest.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#from_address ⇒ Object
Returns the value of attribute from_address.
-
#from_email ⇒ Object
Returns the value of attribute from_email.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#results ⇒ Object
Returns the value of attribute results.
-
#smtp ⇒ Object
Returns the value of attribute smtp.
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
196 197 198 |
# File 'lib/allejest.rb', line 196 def email @email end |
#firstname ⇒ Object
Returns the value of attribute firstname.
196 197 198 |
# File 'lib/allejest.rb', line 196 def firstname @firstname end |
#from_address ⇒ Object
Returns the value of attribute from_address.
196 197 198 |
# File 'lib/allejest.rb', line 196 def from_address @from_address end |
#from_email ⇒ Object
Returns the value of attribute from_email.
196 197 198 |
# File 'lib/allejest.rb', line 196 def from_email @from_email end |
#lastname ⇒ Object
Returns the value of attribute lastname.
196 197 198 |
# File 'lib/allejest.rb', line 196 def lastname @lastname end |
#results ⇒ Object
Returns the value of attribute results.
196 197 198 |
# File 'lib/allejest.rb', line 196 def results @results end |
#smtp ⇒ Object
Returns the value of attribute smtp.
196 197 198 |
# File 'lib/allejest.rb', line 196 def smtp @smtp end |
Instance Method Details
#send_mail ⇒ Object
198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/allejest.rb', line 198 def send_mail raw_erb = File.read(find_erb_path) erb = ERB.new(raw_erb) email_body = erb.result(binding) #.gsub(/^\s*/, '') pony_opts = {:to => "#{firstname} #{lastname} <#{email}>", :from => from_address, :body => email_body, :subject => "AlleJest report for #{Time.new.rfc2822}" } #puts pony_opts.inspect Pony.mail(pony_opts) end |