Changeset - 0d155bc1eace
[Not reviewed]
0 1 0
Lance Edgar (lance) - 10 years ago 2014-10-21 10:42:42
lance@edbob.org
Tweak docs.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/narr/email.rst
Show inline comments
 
@@ -23,48 +23,51 @@ notification example:
 

	
 
   def my_business_logic(config, yesterday_sales):
 
       max_sales = config.get_int('myapp', 'max_sales')
 
       if yesterday_sales > max_sales:
 
           send_email(config, 'sales_max_broken', {'sales': yesterday_sales})
 

	
 
Here also is the API doc for :func:`rattail.mail.send_email()`.
 

	
 
The point here is that ``send_email()`` should require nothing more than a
 
handle on the current configuration object (which should always be available in
 
some direct way), a "key" to distinguish the particular type of event for which
 
the email is being sent, and an optional dictionary to be used as template
 
context when rendering the email body.
 

	
 

	
 
Configuration
 
-------------
 

	
 
There are really three different aspects to the email configuration.
 

	
 
* **Meta Configuration** - transcends "types" of email notification
 
* **Generic Configuration** - common to all types of email notification
 
* **Specific Configuration** - unique to a particular type of email notification
 

	
 
Note that all configuration for this system will fall under the
 
``[rattail.mail]]`` section within your config file(s).
 

	
 

	
 
Meta Configuration
 
^^^^^^^^^^^^^^^^^^
 

	
 
This aspect of configuration consists of settings which have nothing to do with
 
the "type" of email notification involved.  Instead of listing and describing
 
them separately (for now), here is a config snippet which defines each:
 

	
 
.. code-block:: ini
 

	
 
   [rattail.mail
 

	
 
   smtp.server = localhost
 
   smtp.username = mymailuser
 
   smtp.password = mymailpass
 

	
 
   templates =
 
           rattail:templates/email
 
           myproject:templates/email
 

	
 
.. todo::
 
   Need to explain current limitations of SMTP authentication.
 

	
 
.. todo::
0 comments (0 inline, 0 general)