Patrick Samson avatar Patrick Samson committed c027e2c

notification page

Comments (0)

Files changed (9)

 
 Example:
 {{{
+#!html+django
     <a href="{% url postman_write username %}">write to {{ username }}</a>
 }}}
 Separate multiple usernames with a {{{:}}} character.
 
 Example:
 {{{
+#!html+django
     <a href="{% url postman_write 'adm1:adm2:adm3' %}">write to admins</a>
 }}}
 
 
 Example:
 {{{
+#!html+django
     <a href="{% url postman_write %}?subject=details request&body=give me details about ...">
     ask for details
     </a>
 
 Example:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^write/(?:(?P<recipients>[\w.@+-:]+)/)?$', 'write',
 
 For example:
 {{{
+#!python
     from postman.forms import WriteForm
     class MyWriteForm(WriteForm):
         recipients = CommaSeparatedUserField(label="Recipients", min=2, max=5)
 
 For example:
 {{{
+#!python
     class MyThreeAnonymousWriteForm(MyBaseAnonymousWriteForm):
         can_overwrite_limits = False
         recipients = CommaSeparatedUserField(label="Recipients", max=3)
 
 Example:
 {{{
+#!python
     def my_user_filter(user):
         if user.get_profile().is_absent:
             return "is away"
 
 For example:
 {{{
+#!python
     def my_user_filter(user):
         # ...
         return None
 
 An example, with the django-relationships application:
 {{{
+#!python
     def my_exchange_filter(sender, recipient, recipients_list):
         if recipient.relationships.exists(sender, RelationshipStatus.objects.blocking()):
             return "has blacklisted you"
 
 For example:
 {{{
+#!python
     def my_exchange_filter(sender, recipient, recipients_list):
         # ...
         return None
 
 Example:
 {{{
+#!python
     AJAX_LOOKUP_CHANNELS = {
         'postman_users': dict(model='auth.user', search_field='username'),
     }
 
 Example:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^write/(?:(?P<recipients>[\w.@+-:]+)/)?$', 'write',
 
 Example:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^write/(?:(?P<recipients>[\w.@+-:]+)/)?$', 'write',
 
 For example:
 {{{
+#!python
     from postman.forms import WriteForm
     class MyWriteForm(WriteForm):
         recipients = CommaSeparatedUserField(label="Recipients", channel='my_channel')

Frequently_Asked_Questions.wiki

 
     Set the configuration option:
 
-    {{{POSTMAN_AUTO_MODERATE_AS = True}}}
+{{{
+#!python
+    POSTMAN_AUTO_MODERATE_AS = True
+}}}
 
 ----
 <-//[[Management Commands|Previous]]// //[[Home]]//
 What is a message ? Roughly a piece of text, about a subject, sent by a sender to a recipient.
 Each user has access to a collection of messages, stored in folders:
 
-    * **{{{Inbox}}}** for incoming messages
-    * **{{{Sent}}}** for sent messages
-    * **{{{Archives}}}** for archived messages
-    * **{{{Trash}}}** for messages marked as deleted
+    * **Inbox** for incoming messages
+    * **Sent** for sent messages
+    * **Archives** for archived messages
+    * **Trash** for messages marked as deleted
 
 In folders, messages can be presented in two modes:
 
-* by **thread**, for a compact view: the original message and its replies are grouped in a set
+* by **conversation**, for a compact view: the original message and its replies are grouped in a set
   to constitute one sole entry.
   The lastest message (based on the time) is the representative of the set.
 * by **message**, for an expanded view: each message is considered by itself.
 * Optional exchange filtering plug-ins (blacklists)
 * Multi-recipient writing is possible (can be disabled by configuration)
   with min/max constraints
-* Messages are managed in threads
+* Messages are managed by conversations
 * Messages in folders are sortable by sender|recipient|subject|date
 * 'Archives' folder in addition to classic Inbox, Sent and Trash folders
 * A Quick-Reply form to only ask for a response text
 
    * [[Quick Start Guide]]
    * [[Moderation]]
+   * [[Notification]]
    * [[Views]]
    * [[Features]]
    * [[Tags and Filters]]

Management_Commands.wiki

 One reason is to allow a message to be undeleted if the user wants to retrieve it.
 Another reason is that there is only one copy of a message for both the sender and the recipient,
 so the message must be marked for deletion by the two parties before to be considered for a withdraw.
-An additional constraint is that a message may be a member of a thread and the reply chain
+An additional constraint is that a message may be a member of a conversation and the reply chain
 must be kept consistent.
 
 So there are some criteria to fulfill by a record to be really deleted from the database:
 
 * both the sender and the recipient must have marked the message as deleted
-* if the message is in a thread, all the messages of the thread must be marked for deletion
+* if the message is in a conversation, all the messages of the conversation must be marked for deletion
 * the action of deletion must have been done enough time ago
 
 A management command is provided for this purpose:
 
 It can be run as a cron job or directly.
 
-The {{{--days}}} option can be used to specify the minimal number of days a message/thread
+The {{{--days}}} option can be used to specify the minimal number of days a message/conversation
 must have been marked for deletion.
 Default value is 30 days.
 
 === postman_checkup ===
 
 A management command to run a test suite on the messages presently in the database.
-It checks messages and threads for possible inconsistencies, in a read-only mode.
+It checks messages and conversations for possible inconsistencies, in a read-only mode.
 No change is made on the data.
 
 **{{{django-admin.py postman_checkup}}}**
 
 Example:
 {{{
+#!python
     def mod1(message):
         # ...
         return None

Notification.wiki

+== Notification ==
+
+Parties should be notified of these events:
+
+* when a message is rejected
+* when a message or a reply is received
+
+=== For visitors ===
+
+An email is sent, using these templates:
+
+* {{{postman/email_visitor_subject.txt}}} for the subject
+* {{{postman/email_visitor.txt}}} for the body
+
+The available context variables are:
+
+* {{{site}}}: the Site instance
+* {{{object}}}: the Message instance
+* {{{action}}}: 'rejection' or 'acceptance'
+
+Default templates are provided with the application. Same as for the views, you can override them,
+and design yours.
+
+=== For users ===
+
+If a notifier application is configured (see [[Quick Start Guide]]), the following labels are used:
+
+* {{{postman_rejection}}} to notify the sender of the rejection
+* {{{postman_message}}} to notify the recipient of the reception of a message
+* {{{postman_reply}}} to notify the recipient of the reception of a reply
+
+The message object is passed in the call to the notifier application with the {{{message}}} key
+in the {{{extra_context}}} dictionary argument.
+
+If no notifier application is used, an email is sent, using these templates:
+
+* {{{postman/email_user_subject.txt}}} for the subject
+* {{{postman/email_user.txt}}} for the body
+
+The information about context variables and templates is the same as in the {{{For visitors}}} section above.

Quick_Start_Guide.wiki

 * In a production environment, set /<MEDIA_URL>/postman/ as a symlink to <Postman_module>/medias/postman/
 * In a development environment (django's runserver), you can put in the URLconf, something like:
 {{{
+#!python
     ('^' + settings.MEDIA_URL.strip('/') + r'/(?P<path>postman/.*)$', 'django.views.static.serve',
         {'document_root': os.path.join(imp.find_module('postman')[1], 'medias')}),
 }}}
 
 {{{settings.py}}}:
 {{{
+#!python
     INSTALLED_APPS = (
         # ...
         'postman',
 
 {{{urls.py}}}:
 {{{
+#!python
     (r'^messages/', include('postman.urls')),
 }}}
 

Tags_and_Filters.wiki

 
 The following tags and filters are available to your templates by loading the library:
 {{{
+#!html+django
     {% load postman_tags %}
 }}}
 Here are the other special libraries in the {{{postman/templatetags/}}} directory,
 
 Storing the count in a variable for further processing is advised, such as:
 {{{
+#!html+django
     {% postman_unread as unread_count %}
     ...
     {% if unread_count %}
 
 Example:
 {{{
+#!html+django
     <a href="{% postman_order_by subject %}">...</a>
 }}}
 
 
 For example, if we have:
 {{{
+#!html+django
     {{ message.obfuscated_sender|or_me:user }}
 }}}
 and the sender is the currently logged-in user, the output is compacted to show only
 
 For example:
 {{{
+#!html+django
     {{ message.sent_at|compact_date:_("g:i A,M j,n/j/y") }}
 }}}
 With a message sent on "5 dec 2010, 09:21:58":
 
 Here is a sample of some CSS rules, usable for {{{postman/views.html}}}:
 {{{
+#!css
     .pm_message.pm_deleted             { text-decoration: line-through; }
     .pm_message.pm_deleted .pm_body    { display: none; }
     .pm_message.pm_archived            { font-style: italic; color: grey; }
 
 Examples:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^write/(?:(?P<recipients>[\w.@+-:]+)/)?$', 'write',
 
 Example:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^view/(?P<message_id>[\d]+)/$', 'view',
 
 Example:
 {{{
+#!python
     urlpatterns = patterns('postman.views',
         # ...
         url(r'^reply/(?P<message_id>[\d]+)/$', 'reply',
 
 Example:
 {{{
+#!html+django
     <a href="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}">Reply</a>
 }}}
 
 
 Examples:
 {{{
+#!python
     def format_subject(subject):
         return "Re_ " + subject
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.