def before_after_send_handling(self):
        """Context manager that allows to execute send wrapped
        in before_send() and after_send().

        """
        self._init_delivery_statuses_dict()
        self.before_send()

        try:
            yield

        finally:
            self.after_send()
            self._update_dispatches()