Class: LogTimer::Mailer
- Inherits:
-
Object
- Object
- LogTimer::Mailer
- Defined in:
- lib/log_timer/mailer.rb
Overview
Handles sending of mails via smtp or local (mail-utils)
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#smtp_password ⇒ Object
Returns the value of attribute smtp_password.
-
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
-
#smtp_server ⇒ Object
Returns the value of attribute smtp_server.
-
#smtp_user ⇒ Object
Returns the value of attribute smtp_user.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(options) ⇒ Mailer
constructor
A new instance of Mailer.
- #send(subject, body) ⇒ Object
Constructor Details
#initialize(options) ⇒ Mailer
Returns a new instance of Mailer.
8 9 10 |
# File 'lib/log_timer/mailer.rb', line 8 def initialize() = end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def from @from end |
#smtp_password ⇒ Object
Returns the value of attribute smtp_password.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def smtp_password @smtp_password end |
#smtp_port ⇒ Object
Returns the value of attribute smtp_port.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def smtp_port @smtp_port end |
#smtp_server ⇒ Object
Returns the value of attribute smtp_server.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def smtp_server @smtp_server end |
#smtp_user ⇒ Object
Returns the value of attribute smtp_user.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def smtp_user @smtp_user end |
#to ⇒ Object
Returns the value of attribute to.
6 7 8 |
# File 'lib/log_timer/mailer.rb', line 6 def to @to end |
Instance Method Details
#send(subject, body) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/log_timer/mailer.rb', line 12 def send(subject, body) if [:smtp_server] && ![:smtp_server].empty? send_mail_smtp((subject, body)) else send_mail_local(subject, body) end end |