Newer
Older
# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module RakeHelpers
def process_emails(csv, num_to_process, offset, num_invites=10, test=true)
churn_through = 0
num_to_process.times do |n|
if backers[n+offset] == nil
break
end
churn_through = n
backer_name = backers[n+offset][0].to_s.strip
backer_email = backers[n+offset][1].to_s.gsub('.ksr', '').strip
puts "sending email to: #{backer_name} #{backer_email}" unless Rails.env == 'test'
Invitation.create_invitee(:service => 'email', :identifier => backer_email, :name => backer_name, :invites => num_invites) unless test
puts "user with the email exists: #{backer_email} , #{backer_name} " unless Rails.env == 'test'