I hacked a bit, this is not perfect, but it works.
If you use
default "SOMEHEADER", Proc.new { set_layout }
And then define set_layout
def set_layout attachments.inline["logo.png"] = File.read("logopath.png") attachments.inline["footer.jpg"] = File.read("footerpath.png") "SOME HEADER VALUE" end
Then, since set_layout receives the call to set the header, it also adds inline attachments. It basically creates a callback to add attachments.
It prefers a real callback system in ActionMailer , but it works too.
I think that I will share since I was looking for this answer on this issue today.
jesse reiss
source share