Merge branch 'master' into 'master'
epaper out format See merge request !1
This commit is contained in:
commit
d88174a8a8
|
@ -48,7 +48,7 @@ def initialize
|
||||||
def send_test_email
|
def send_test_email
|
||||||
paper_criteria = PaperCriteria.find(params[:id])
|
paper_criteria = PaperCriteria.find(params[:id])
|
||||||
page = Page.where(:module => "e_paper").first.url rescue ""
|
page = Page.where(:module => "e_paper").first.url rescue ""
|
||||||
email = Email.new(:mail_subject => paper_criteria.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper_criteria, "page" => "http://" + request.host_with_port + page}, :mail_to => params[:email])
|
email = Email.new(:mail_subject => paper_criteria.sending_title, :mail_lang => :zh_tw, :template => "admin/e_paper_criterias/emailer", :template_data => {"paper" => paper_criteria, "page" => "http://" + request.host_with_port + page, "siteurl" => "http://" + request.host_with_port }, :mail_to => params[:email])
|
||||||
email.deliver
|
email.deliver
|
||||||
render :json => {"success" => true}.to_json
|
render :json => {"success" => true}.to_json
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<% paper = @data["paper"] %>
|
<% paper = @data["paper"] %>
|
||||||
<% page = @data["page"] %>
|
<% page = @data["page"] %>
|
||||||
|
<% siteurl = @data["siteurl"] %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -159,8 +160,9 @@
|
||||||
<% paper.epaper_topics.desc(:created_at).each do |topic| %>
|
<% paper.epaper_topics.desc(:created_at).each do |topic| %>
|
||||||
<div class="ep-content-item">
|
<div class="ep-content-item">
|
||||||
<a class="ep-content-title" href="<%= page + "/" + topic.to_param %>" target="_blank"><%= topic.title %></a>
|
<a class="ep-content-title" href="<%= page + "/" + topic.to_param %>" target="_blank"><%= topic.title %></a>
|
||||||
|
<img src="<%= siteurl + "/" + topic.image.thumb.url %>">
|
||||||
<% t = strip_tags(topic.content) %>
|
<% t = strip_tags(topic.content) %>
|
||||||
<p class="ep-content-text"><%= t[0..100] %></p>
|
<%= topic.description %>
|
||||||
<a class="ep-content-more" href="<%= page + "/" + topic.to_param %>" target="_blank">more</a>
|
<a class="ep-content-more" href="<%= page + "/" + topic.to_param %>" target="_blank">more</a>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace :epaper do
|
||||||
subscriber.save
|
subscriber.save
|
||||||
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}, :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 }, :mail_to => emails)
|
||||||
email.deliver
|
email.deliver
|
||||||
emails = []
|
emails = []
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
@ -26,7 +26,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}, :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 }, :mail_to => emails)
|
||||||
email.deliver
|
email.deliver
|
||||||
emails = []
|
emails = []
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
@ -35,7 +35,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}, :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 }, :mail_to => emails)
|
||||||
email.deliver
|
email.deliver
|
||||||
end
|
end
|
||||||
paper.save
|
paper.save
|
||||||
|
|
Loading…
Reference in New Issue