-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why a proprietary attachments API? #17
Comments
Really why? |
This was the reason it developed my own gem: 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 => "[email protected]"
def some_email
attachments['1.jpeg'] = File.read(Rails.root.join('tmp/1.jpeg'))
mail :subject => 'Native attachments API', :to => '[email protected]'
end
end |
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 |
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:
http://api.rubyonrails.org/classes/ActionMailer/Base.html#method-i-attachments
The text was updated successfully, but these errors were encountered: