Class: NotificationEmailer
- Inherits:
-
Object
- Object
- NotificationEmailer
- Defined in:
- app/services/notification_emailer.rb
Defined Under Namespace
Classes: EmailUser
Class Method Summary collapse
Class Method Details
.disable ⇒ Object
128 129 130 |
# File 'app/services/notification_emailer.rb', line 128 def self.disable @disabled = true end |
.enable ⇒ Object
132 133 134 |
# File 'app/services/notification_emailer.rb', line 132 def self.enable @disabled = false end |
.process_notification(notification, no_delay: false) ⇒ Object
136 137 138 139 140 141 142 |
# File 'app/services/notification_emailer.rb', line 136 def self.process_notification(notification, no_delay: false) return if @disabled email_user = EmailUser.new(notification, no_delay: no_delay) email_method = Notification.types[notification.notification_type] email_user.public_send(email_method) if email_user.respond_to? email_method end |