* Also notify the influence submitter that his influence was modified.
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 1 Feb 2008 09:25:07 +0000 (10:25 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Fri, 1 Feb 2008 09:25:07 +0000 (10:25 +0100)
influences/notify.py
templates/influences/email/influence_changed [new file with mode: 0644]

index 3cbb94eddc8d0257f350e1605b49473cbdf9e688..2bf7483d7b805e84e1e65a06e3a58b4de9aae5e6 100644 (file)
@@ -8,3 +8,9 @@ def character_saved(instance, created):
     notify(instance.player, 'influences/email/character_changed', {'character' : instance, 'created' : created})
 
 dispatcher.connect(character_saved, signals.post_save, Character)
+
+def influence_saved(instance, created):
+    # TODO: Perhaps only notify when the status is / becomes Done?
+    notify(instance.character.player, 'influences/email/influence_changed', {'influence' : instance, 'created' : created})
+
+dispatcher.connect(influence_saved, signals.post_save, Influence)
diff --git a/templates/influences/email/influence_changed b/templates/influences/email/influence_changed
new file mode 100644 (file)
index 0000000..e9b72bf
--- /dev/null
@@ -0,0 +1,21 @@
+{% autoescape off %}From: Inschrijfsysteem <inschrijf@evolution-events.nl>
+Subject: Influence {{ influence }} was changed.
+
+{% filter lower|wordwrap:72 %}
+You have submitted an influence on {{influence.created}}.
+{% if not created %}The influence has been modified. The current status is:{% else %}You submitted:{% endif %}
+{% endfilter %}
+Character:       {{ influence.character }}
+Contact:         {{ influence.contact }}
+Summary:         {{ influence.summary }}
+Status:          {{ influence.get_status_display }}
+Long term:       {{ influence.longterm }}
+
+Description:
+{{ influence.description }}
+
+{% if influence.result %}
+Result:
+{{ influence.result }}
+{% endif %}
+{% endautoescape %}