Skip to content
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

Closed
jjb opened this issue Jan 3, 2012 · 9 comments
Closed

Why a proprietary attachments API? #17

jjb opened this issue Jan 3, 2012 · 9 comments

Comments

@jjb
Copy link

jjb commented Jan 3, 2012

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

@dnagir
Copy link

dnagir commented Feb 3, 2012

Really why?

@jjb
Copy link
Author

jjb commented Feb 5, 2012

@isabanin @wildbit any thoughts on this?

@Aupajo
Copy link

Aupajo commented Sep 15, 2012

@isabanin @wildbit +1

@ream88
Copy link

ream88 commented Nov 14, 2012

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.

@temochka
Copy link
Contributor

Thank you for pushing this! Native attachments support is coming this week. I'll let you know when you can update.

@temochka
Copy link
Contributor

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

@realmassiveCEO
Copy link

Can you post a simple snippet for saving attachments from an email using th native API , too? thanks

@temochka
Copy link
Contributor

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.

@jjb
Copy link
Author

jjb commented Mar 15, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants