def notify(self, alert, query, user, new_state, app, host): if self.destination: return self.destination.notify(alert, query, user, new_state, app, host) else: # User email subscription, so create an email destination object config = {"addresses": self.user.email} schema = get_configuration_schema_for_destination_type("email") options = ConfigurationContainer(config, schema) destination = get_destination("email", options) return destination.notify(alert, query, user, new_state, app, host, options)
def notify(self, alert, query, user, new_state, app, host): if self.destination: return self.destination.notify(alert, query, user, new_state, app, host) else: # User email subscription, so create an email destination object config = {'addresses': self.user.email} schema = get_configuration_schema_for_destination_type('email') options = ConfigurationContainer(config, schema) destination = get_destination('email', options) return destination.notify(alert, query, user, new_state, app, host, options)
def notify(self, alert, query, user, new_state, app, host): if self.destination: return self.destination.notify(alert, query, user, new_state, app, host) else: # User email subscription, so create an email destination object config = {'email': self.user.email} schema = get_configuration_schema_for_destination_type('email') options = ConfigurationContainer(json.dumps(config), schema) destination = get_destination('email', options) return destination.notify(alert, query, user, new_state, app, host, options)
def destination(self): return get_destination(self.type, self.options)