From: Matthijs Kooijman Date: Thu, 31 Jan 2008 17:30:35 +0000 (+0100) Subject: * Send an email to the player when a character is modified. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=b69c90a1bdebcef58c9ee83eec490637af3a577f;p=matthijs%2Fprojects%2Fxerxes.git * Send an email to the player when a character is modified. --- diff --git a/influences/__init__.py b/influences/__init__.py index e69de29..d1e981c 100644 --- a/influences/__init__.py +++ b/influences/__init__.py @@ -0,0 +1 @@ +import notify diff --git a/influences/notify.py b/influences/notify.py new file mode 100644 index 0000000..3cbb94e --- /dev/null +++ b/influences/notify.py @@ -0,0 +1,10 @@ +from django.db.models import signals +from django.dispatch import dispatcher +from ee.influences.models import Character,Influence +from ee.tools.notify import notify +from django.contrib.auth.models import Group + +def character_saved(instance, created): + notify(instance.player, 'influences/email/character_changed', {'character' : instance, 'created' : created}) + +dispatcher.connect(character_saved, signals.post_save, Character) diff --git a/templates/influences/email/character_changed b/templates/influences/email/character_changed new file mode 100644 index 0000000..542250b --- /dev/null +++ b/templates/influences/email/character_changed @@ -0,0 +1,4 @@ +From: Inschrijfsysteem +Subject: Character {{ character }} was changed. + +Pomtieflomptie