Class: NotificationHub::Channels::Email::ActionMailer
- Defined in:
- lib/notification_hub/channels/email/action_mailer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(configuration) ⇒ ActionMailer
constructor
A new instance of ActionMailer.
Constructor Details
#initialize(configuration) ⇒ ActionMailer
9 10 11 |
# File 'lib/notification_hub/channels/email/action_mailer.rb', line 9 def initialize(configuration) super end |
Class Method Details
.send_message(event_code, data, options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/notification_hub/channels/email/action_mailer.rb', line 14 def (event_code, data, ) event = event_code.split(".") begin if Rails.version.to_f >= 4.2 "#{event[0].camelize}Mailer".constantize.send(event[1].to_sym, data, [:email]).deliver_now else "#{event[0].camelize}Mailer".constantize.send(event[1].to_sym, data, [:email]).deliver end rescue => exception raise "Email::ActionMailer Error: #{exception.message}" end end |