def send(self, *args, **kwargs): try: self._send_or_retry(*args, **kwargs) stats.email_sent(recipient_count=len(self.to), category=self.stats_category) except Exception as exception: stats.email_error(recipient_count=len(self.to), category=self.stats_category) raise exception
def send(self, *args, **kwargs): try: super(StatCollectingAnymailMessage, self).send(*args, **kwargs) stats.email_sent(recipient_count=len(self.to)) except Exception as exception: stats.email_error(recipient_count=len(self.to)) raise exception