Sending email with attachments
问题 I've got a mailer that as follows: class Payments::LateNoticesMailer < AsyncMailer def notice(payment_id) @payment = PaymentDecorator.find(payment_id) @invoice = @payment.invoice template = "payments/invoices/#{@payment.made_with_type.downcase}/show" attachments["#{@payment.invoice_filename}.pdf"] = WickedPdf.new.pdf_from_string( render_to_string( pdf: @payment.invoice_filename, formats: [:pdf], template: template, layout: "layouts/pdf.html")) mail to: @payment.payer_email, from: '