carrierwave
https://github.com/carrierwaveuploader/carrierwave
Ruby
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
Mail.register_interceptor
You can register an object to be given every mail object that will be sent, before it is sent. So if you want to add special headers or modify any email that gets sent through the Mail library, you can do so. Your object needs to respond to a single method #delivering_email(mail) which receives the email that is about to be sent. Make your modifications directly to this object.
Edit
git clone [email protected]:carrierwaveuploader/carrierwave.git
cd carrierwave
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Mail-register_interceptor-for-pr
# Commit to gitgit add git commit -m "better docs for Mail.register_interceptor"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Mail-register_interceptor-for-pr
hub pull-request
# Celebrate!