Class: Ziltoid::EmailNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/ziltoid/email_notifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ EmailNotifier

Returns a new instance of EmailNotifier.



7
8
9
10
11
12
# File 'lib/ziltoid/email_notifier.rb', line 7

def initialize(options)
  self.via_options = options[:via_options]
  self.to = options[:to]
  self.from = options[:from]
  self.subject = options[:subject]
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



5
6
7
# File 'lib/ziltoid/email_notifier.rb', line 5

def from
  @from
end

#subjectObject

Returns the value of attribute subject.



5
6
7
# File 'lib/ziltoid/email_notifier.rb', line 5

def subject
  @subject
end

#toObject

Returns the value of attribute to.



5
6
7
# File 'lib/ziltoid/email_notifier.rb', line 5

def to
  @to
end

#via_optionsObject

Returns the value of attribute via_options.



5
6
7
# File 'lib/ziltoid/email_notifier.rb', line 5

def via_options
  @via_options
end

Instance Method Details

#send(message) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/ziltoid/email_notifier.rb', line 14

def send(message)
  Pony.mail(
    :to => self.to,
    :via => :smtp,
    :via_options => self.via_options,
    :from => self.from,
    :subject => self.subject, :body => message
  )
end