title: Multiple attachements with ActionMailer?
body: <p>I am successfully sending emails with one PDF attachment using action mailer but I now have a need to send multiple PDF attachements in one email. I had hoped I could just pass in my products and loop, rendering a file on each iteration but that doesn't seem to work. Can anyone help guide me in the right direction here please? Here's what I have tried:</p>
  
  <pre><code>def sales_notes(products)
  
    products.each do |product|
      pdf = Salesnote.new(product, @user_role)
      @pdf_filename = "#{product.cat_no} - #{product.release.artists.map { |a| a.name}.join (", ")} - #{product.release.title}.pdf"
      mail.attachments[@pdf_filename] = pdf.render
    end  
  
    mail(:to =&gt; "me@mydomain.com", :subject =&gt; "SALES NOTES ATTACHED")
  
  
    end  
  </code></pre>
  
  <p>I have also tried with just <code>attachments[@pdf_filename]</code> instead of <code>mail.attachments[@pdf_filename]</code></p>
  
  <p>Thanks in advance.</p>