Ruby on rails 如何通过电子邮件发送使用PDFKit和Rails中Heroku生成的PDF?
我在Heroku上使用PDFKit,在本地也在为开发人员使用PDFKit,从我的cron任务发送生成PDF的电子邮件时遇到困难 这是我的cron作业中的代码:Ruby on rails 如何通过电子邮件发送使用PDFKit和Rails中Heroku生成的PDF?,ruby-on-rails,heroku,actionmailer,pdfkit,Ruby On Rails,Heroku,Actionmailer,Pdfkit,我在Heroku上使用PDFKit,在本地也在为开发人员使用PDFKit,从我的cron任务发送生成PDF的电子邮件时遇到困难 这是我的cron作业中的代码: kit = PDFKit.new(html_file) file = kit.to_pdf OutboundMailer.deliver_pdf_email(file) #kit.render_file("pdf_from_cron.pdf") 这是我的邮件中的代码: def pdf_
kit = PDFKit.new(html_file)
file = kit.to_pdf
OutboundMailer.deliver_pdf_email(file)
#kit.render_file("pdf_from_cron.pdf")
这是我的邮件中的代码:
def pdf_email(pdf)
subject "This is your batch of letters"
recipients "helloworld@gmail.com"
from "Batch Email <hello@batch.com>"
sent_on Date.today
body "This is the body of pdf"
attachment "application/pdf" do |a|
a.filename = "batch-letters.pdf"
a.body = pdf
end
end
我在Heroku上设置了一次PDFKit,并遵循:。您可能需要包含二进制文件。我在Heroku上设置了一次PDFKit,然后:。您可能需要包含二进制文件。您好,是的,我在读那个博客,它引用了CustomMailer的名字…我想我和那个博客一样做了,但仍然不起作用…帮助?@Kevin…日志中没有错误…我很确定我可以从我的开发箱发送电子邮件…似乎没有发送任何东西…在heroku上生成pdf:然后再发电子邮件嗨,是的,我在读那个博客,它引用了CustomMailer的名字……我想我和那个博客一样,但仍然不起作用……帮助?@Kevin……日志中没有错误……我很确定我可以从我的开发箱发送电子邮件……似乎没有发送任何东西……在heroku上生成pdf:然后再发送电子邮件