devise

https://github.com/plataformatec/devise

Ruby

Flexible authentication solution for Rails with Warden.

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.

Source | Google | Stack overflow

Edit

git clone [email protected]:plataformatec/devise.git

cd devise

open

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Mail-register_interceptor-for-pr


# Commit to git

git add git commit -m "better docs for Mail.register_interceptor"


# Open pull request

gem 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!