* Send an email to the player when a character is modified.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 31 Jan 2008 17:30:35 +0000 (18:30 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 31 Jan 2008 17:30:35 +0000 (18:30 +0100)
influences/__init__.py
influences/notify.py [new file with mode: 0644]
templates/influences/email/character_changed [new file with mode: 0644]

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d1e981c705437138a022515a25b1d76db395b9f1 100644 (file)
@@ -0,0 +1 @@
+import notify
diff --git a/influences/notify.py b/influences/notify.py
new file mode 100644 (file)
index 0000000..3cbb94e
--- /dev/null
@@ -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 (file)
index 0000000..542250b
--- /dev/null
@@ -0,0 +1,4 @@
+From: Inschrijfsysteem <inschrijf@evolution-events.nl>
+Subject: Character {{ character }} was changed.
+
+Pomtieflomptie