Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ mail.deliver some_message

mail.use :null # switch back to the null implementation.
```
Sometimes you'll want to use an implementation for the duration of a block:

```
mailer = Mailer.new
mailer.register :snail_mail, SnailMail.new

mailer.with(:smtp) do |smtp_mailer|
smtp_mailer.deliver some_message
end

mailer.deliver some_message_with_snail_mail
```

These objects are useful when you have an interaction that needs
to happen but implementations can vary widely. You can also use this
Expand Down