From b69c90a1bdebcef58c9ee83eec490637af3a577f Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 31 Jan 2008 18:30:35 +0100 Subject: [PATCH] * Send an email to the player when a character is modified. --- influences/__init__.py | 1 + influences/notify.py | 10 ++++++++++ templates/influences/email/character_changed | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 influences/notify.py create mode 100644 templates/influences/email/character_changed 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 -- 2.30.2