Commits

Owen Nelson committed 7f2cff3

re-docing (refs #8)

  • Participants
  • Parent commits 1d48e5d

Comments (0)

Files changed (1)

File docs/user_guide.rst

     register links and images viewed as normal. Use this to verify your links
     are correct (or to see how your spam filter reacts to the message).
 
+Writing your Message
+--------------------
+
+Ther are some things to consider as you compose your message.
+
+Plain and HTML content types
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    Many mail clients support the rendering of html content however the
+    Plain is required.
+
+The message template context
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Both the plain and html message fields are used as django templates, with
+context substitutions being made per Target right before the email is sent 
+out to them.
+
+The template context provieds access to the target instance via the variable
+**{{ target }}**.
+
+The target object provides a number of helpful properties:
+
+**{{ target.img_uri }}**:
+    The target-specific image src (relative to site root).
+**{{ target.link_uri }}**:
+    The target-specific link href (relative to site root)
+**{{ target.extra }}**:
+    Each target has an ``extra_context`` field. Given a 
+    comma seperated key=val list in this field, that data will be avialble
+    to you via ``{{ target.extra }}``.
+
+    For example, if the extra context for a target had ::
+        first_name=Owen, last_name=Nelson
+    
+    you could include ::
+        
+        Hello {{ target.extra.first_name }} {{ target.extra.last_name }}
+
+    in your message. If all your targets in this campaign also had these
+    extras specified correctly, you could send a highly personalized email
+    to each of your targets.
+    
+    This is really only meant for simple values. If trawler is not able
+    to cleanly and simply parse out the ``x=1, y=2, z=3`` in this field,
+    values may be skipped. By default (in django templates) accessing
+    values that are not there will result in nothing being printed. Just
+    be aware that these values are being silently dropped - there will be 
+    no notification issued by the system.
+
+The main thing to take away is that this block of text is just a django
+template. While the ``context`` is limited, you should be able to use any
+of the default template tags and filters that ship with django.
+
+For more information on the django template system, see the 
+`django docs <https://docs.djangoproject.com>`_.
+
+
 Monitoring the Campaign
 -----------------------