e_paper/app/helpers/admin/subscribers_helper.rb

15 lines
500 B
Ruby
Raw Permalink Normal View History

2017-07-05 09:16:55 +00:00
require "net/http"
require "uri"
module Admin::SubscribersHelper
def send_email(name, useremail, epaper)
url = "http://#{request.host_with_port}/admin/epapers?url=#{page_for_topic(epaper).sub("http://" + request.host_with_port, "")}&id=#{epaper.id}"
email = Email.new(:mail_to => useremail, :mail_subject => " #{t("e_paper.title")} : #{epaper.title}.", :template => "email/subscriber_email.html.erb", :template_data => {"html" => datatosend})
email.deliver rescue nil
end
end