Pass `doc` to `on_before_dispatch`

This allows users to log outgoing documents before they are sent.
Merge pull request #37 from covermymeds/on-before-dispatch-gets-doc

Pass `doc` to `on_before_dispatch`