【发布时间】:2020-05-22 01:31:33
【问题描述】:
我在本地 ubuntu 18 机器上的开发环境中运行 rails 和 redis。
ActionMailer 正在适当地发送电子邮件,但似乎我的计算机已关闭,第二天我来启动 redis,它重新发送了一堆电子邮件。
#invoice controller
InvoiceMailer.send_invoice_to_email(email, @invoice).deliver_later
#InvoiceMailer
def send_invoice_to_email(email, invoice)
@invoice = invoice
attachments["test_invoice_#{invoice.id}_#{Date.today}.pdf"] = WickedPdf.new.pdf_from_string(
render_to_string(pdf: 'Invoice', template: '/invoices/show.pdf.erb', layout: 'application')
)
bcc = ["test <test@test.com>", "test2 <test2@test.com>"]
mail(from: "Test <info@test.com>", to: email, bcc: bcc, subject: "Invoice From test")
end
我的问题可能是什么?我该如何调试?
【问题讨论】:
标签: ruby-on-rails-4 redis actionmailer sidekiq