Why doesn't the gem use the ActionMailer attachments API, or at least capture it if the hash is present? It seems like the parameters involved are identical or a subset:
@iSabanin @wildbit any thoughts on this?
@isabanin @wildbit +1
This was the reason it developed my own gem: simple_postmark which supports the standard Rails attachments API.
It's already mentioned in the official docs, in case you missed it.
Thank you for pushing this! Native attachments support is coming this week. I'll let you know when you can update.
Yesterday I released postmark gem 0.9.19 which supports native attachments API provided by Ruby Mail library. It makes the gem compatible with ActionMailer attachments API too. Legacy API is kept for compatibility reasons, but will be deprecated after version 1.0.
class TestMailer < ActionMailer::Base
default :from => "firstname.lastname@example.org"
attachments['1.jpeg'] = File.read(Rails.root.join('tmp/1.jpeg'))
mail :subject => 'Native attachments API', :to => 'email@example.com'
Can you post a simple snippet for saving attachments from an email using th native API , too? thanks
Sorry, what exactly do you mean by "saving attachments"? If you're talking about Postmark Inbound, the rails gem currently doesn't provide any support for that.
woot! thanks @temochka !
in my implementation, after updating, now each attachement is sent twice. this is because i was populating both the ActionMailer hash and the proprietary postmark hash so whichever context i was in would just use it. not a big deal for my use case, but just pointing that out -- maybe you could do a simple check for redundancy