This commit is contained in:
BoHung Chiu 2020-11-30 23:59:51 +08:00
parent 55b30b3dae
commit f9a411ae60
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
<% paper = @data["paper"] %> <% paper = PaperCriteria.find(@data["paper_id"]) rescue nil %>
<% paper = @data["paper"] if paper.nil? && @data["paper"] != nil %>
<% page = @data["page"] %> <% page = @data["page"] %>
<% siteurl = @data["siteurl"] %> <% siteurl = @data["siteurl"] %>
<% papers_data = @data["papers_data"] %> <% papers_data = @data["papers_data"] %>

View File

@ -23,7 +23,7 @@ namespace :epaper do
Thread.new do Thread.new do
tmp = [] tmp = []
emails_valid.each_slice(mail_limit).each do |slice_emails| emails_valid.each_slice(mail_limit).each do |slice_emails|
email = Email.new(:mail_subject => paper.sending_title, :mail_lang => args[:locale], :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper, "page" => "http://" + domain + page, "siteurl" => "http://" + domain, "papers_data" => papers_data }, :mail_to => slice_emails) email = Email.new(:mail_subject => paper.sending_title, :mail_lang => args[:locale], :template => "admin/e_paper_criterias/emailer", :template_data => {"paper_id" => paper.id, "page" => "http://" + domain + page, "siteurl" => "http://" + domain, "papers_data" => papers_data }, :mail_to => slice_emails.join(","))
begin begin
email.save email.save
email.deliver email.deliver