Class: Newsly::NewsletterBatchSender

Inherits:
Object
  • Object
show all
Defined in:
app/workers/newsly/newsletter_batch_sender.rb

Class Method Summary collapse

Class Method Details

.perform(newsletter_id, recipient_group, batch_size) ⇒ Object



4
5
6
7
8
# File 'app/workers/newsly/newsletter_batch_sender.rb', line 4

def self.perform(newsletter_id, recipient_group, batch_size)
 Newsly.get_newsletter_receipient_group(recipient_group.to_sym).call(newsletter_id).limit(batch_size).each do |resource|
   Newsly::Mailer.async_deliver.build_newsletter(newsletter_id, resource.send(Newsly.resource_email_column), resource.to_liquid)
 end
end