From a6282477ae53bf9c81d41dea45ca3ac1afb0c083 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 27 Aug 2020 18:02:55 +0800 Subject: [PATCH] Fix sending email. --- lib/tasks/e_paper_tasks.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/e_paper_tasks.rake b/lib/tasks/e_paper_tasks.rake index bbaf797..46527b6 100644 --- a/lib/tasks/e_paper_tasks.rake +++ b/lib/tasks/e_paper_tasks.rake @@ -27,7 +27,7 @@ namespace :epaper do emails << email if emails.count == mail_limit 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 emails = [] sleep 0.5 @@ -36,7 +36,7 @@ namespace :epaper do end if !emails.empty? 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 end paper.save