Skip to content

Commit

Permalink
[Scott] - reduced the batch_size for bulk emailing via sendgrid
Browse files Browse the repository at this point in the history
Sendgrid's parsing of bulk mailing headers fails when the header is too large (batch size is too big).
  • Loading branch information
scottefein authored and johnam committed Aug 5, 2013
1 parent 39bbcc6 commit 5970d71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def movement=(new_movement)
push.campaign.movement = new_movement
end

def deliver_blast_in_batches(user_ids, batch_size=1000)
def deliver_blast_in_batches(user_ids, batch_size=100)
batch_size = 100 if batch_size > 100

user_ids.each_slice(batch_size) do |slice|
begin
recipients = User.select(:email).where(:id => slice).order(:email).map(&:email)
Expand Down

0 comments on commit 5970d71

Please sign in to comment.