15 lines
500 B
Ruby
15 lines
500 B
Ruby
|
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
|