def after(self, event, state): extra = {"event_id": event.event_id} group = event.group target_type = ActionTargetType(self.data["targetType"]) if not mail_adapter.should_notify(target_type, group=group): extra["group_id"] = group.id self.logger.info("rule.fail.should_notify", extra=extra) return metrics.incr("notifications.sent", instance=self.metrics_slug, skip_internal=False) yield self.future( lambda event, futures: mail_adapter.rule_notify( event, futures, target_type, self.data.get("targetIdentifier", None) ) )
def rule_notify(self, event, futures): metrics.incr("mail_plugin.rule_notify") return mail_adapter.rule_notify(event, futures, target_type=ActionTargetType.ISSUE_OWNERS)