3.5. Alert Method Sample

This is the base class that must be used when defining a custom alert_method.

3.5.1. AlertMethodBase

Base class for alert method interface.

class Alerts.method_base.AlertMethodBase[source]
This is a skeleton AlertMethod. It should handle the following:
send_alert(to_users, message, from_user, sub_group)
-Send alert to given to_users. Should handle an unregistered user
-Return True if this method requires per-user signup (i.e. Jabber)
Return False if no per-user registration is required (i.e. Slack)
register_user(user, sub_group)
-Register the provided user and subscription group as being handled
by this method.
unregister_user(user, sub_group)
-Unregister the given user and subscription group combo
is_registered(user, sub_group)
-Return True if the user and subscripiton group are registered
-Return a text description of the method
description(user, sub_group)[source]

Return a one-sentence descritpion of the method for the user to see.


Hail Bob.

is_registered(user, sub_group)[source]

Return True if the user / group combo is registered.


Does this alert method require per-user registration?

register_user(user, sub_group)[source]

Register a user / subscription group combo to recieve alerts.

send_alert(to_users, message, from_user, sub_group)[source]

Send a message to the given user with the message text, from and group.

unregister_user(user, sub_group)[source]

Unregister a user / subscription group combo.