Class: Kublog::Network::Email::BulkEmail
- Inherits:
-
Object
- Object
- Kublog::Network::Email::BulkEmail
- Defined in:
- lib/kublog/network/email.rb
Instance Method Summary collapse
-
#initialize(notification) ⇒ BulkEmail
constructor
A new instance of BulkEmail.
-
#perform ⇒ Object
Processes sending email to bunch of users if appropriate calls notify_post? on every user to determine whether or not to send e-mail.
Constructor Details
#initialize(notification) ⇒ BulkEmail
Returns a new instance of BulkEmail.
69 70 71 72 |
# File 'lib/kublog/network/email.rb', line 69 def initialize(notification) @notification = notification @post = notification.post end |
Instance Method Details
#perform ⇒ Object
Processes sending email to bunch of users if appropriate calls notify_post? on every user to determine whether or not to send e-mail
77 78 79 80 81 82 83 84 |
# File 'lib/kublog/network/email.rb', line 77 def perform klass = eval(Kublog.notify_class) klass.all.each do |user| if user.notify_post?(@notification.roles) Processor.work(SingleEmail.new(@notification, user)) end end end |