Class: CampfireBot::AbsenteeCamper::Notification::EmailNotifier

Inherits:
Object
  • Object
show all
Includes:
Config, Helpers
Defined in:
lib/campfire_bot/absentee_camper/notification/email_notifier.rb

Instance Method Summary collapse

Methods included from Helpers

#room_uri

Methods included from Config

#plugin_config, #root_config

Constructor Details

#initialize(room, user_id) ⇒ EmailNotifier

Returns a new instance of EmailNotifier.



10
11
12
13
# File 'lib/campfire_bot/absentee_camper/notification/email_notifier.rb', line 10

def initialize(room, user_id)
  @email_address = room.user(user_id)['email_address']
  @room = room
end

Instance Method Details

#notify(message) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/campfire_bot/absentee_camper/notification/email_notifier.rb', line 15

def notify(message)
  Logger.instance.debug "sending email to #{@email_address}"
  Pony.mail({
    :to => @email_address,
    :body => email_body(message)
  }.merge(pony_options))
end