Ruby on Rails - actionmailer interceptor in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
- Action Mailer provides hooks into the interceptor methods. These allow us to register classes that are called during the mail delivery life cycle.
- An interceptor class must implement the :delivering_email(message) method which will be called before the email is sent, allowing us to make modifications to the email before it hits the delivery agents. our class should make any needed modifications directly to the passed in Mail::Message instance.
- It can be useful for developers to send email to themselves not real users.
Example
- Registering an actionmailer interceptor