Fix sending email.
This commit is contained in:
parent
6c4c028dcc
commit
a6282477ae
|
@ -27,7 +27,7 @@ namespace :epaper do
|
||||||
emails << email
|
emails << email
|
||||||
if emails.count == mail_limit
|
if emails.count == mail_limit
|
||||||
puts "Sending #{mail_limit} mails"
|
puts "Sending #{mail_limit} mails"
|
||||||
email = Email.new(:mail_subject => paper.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper, "page" => "http://" + domain + page, "siteurl" => "http://" + domain }, :mail_to => emails)
|
email = Email.new(:mail_subject => paper.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper, "page" => "http://" + domain + page, "siteurl" => "http://" + domain, "papers_data" => papers_data }, :mail_to => emails)
|
||||||
email.deliver
|
email.deliver
|
||||||
emails = []
|
emails = []
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
@ -36,7 +36,7 @@ namespace :epaper do
|
||||||
end
|
end
|
||||||
if !emails.empty?
|
if !emails.empty?
|
||||||
puts "Sending last emails"
|
puts "Sending last emails"
|
||||||
email = Email.new(:mail_subject => paper.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper, "page" => "http://" + domain + page, "siteurl" => "http://" + domain }, :mail_to => emails)
|
email = Email.new(:mail_subject => paper.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper, "page" => "http://" + domain + page, "siteurl" => "http://" + domain, "papers_data" => papers_data }, :mail_to => emails)
|
||||||
email.deliver
|
email.deliver
|
||||||
end
|
end
|
||||||
paper.save
|
paper.save
|
||||||
|
|
Loading…
Reference in New Issue