Package turbomail :: Module message :: Class KIDMessage
[hide private]
[frames] | no frames]

Class KIDMessage

source code

object --+    
         |    
   Message --+
             |
            KIDMessage

A message that accepts a named template with arguments.

Example usage:
       import turbomail
       message = turbomail.KIDMessage(
                       "from@host.com",
                       "to@host.com",
                       "Subject",
                       "app.templates.mail",
                       dict()
               )
Do not specify message.plain or message.rich content - the template will override what you set. If you wish to hand-produce content, use the Message class.

Instance Methods [hide private]
 
__init__(self, sender, recipient, subject, template, variables={}, **kw)
Store the additional template and variable information.
source code
 
_process(self)
Automatically generate the plain and rich text content.
source code

Inherited from Message: __call__, __setattr__, attach, embed

Inherited from Message (private): _normalize

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __str__

Instance Variables [hide private]

Inherited from Message: attachments, bcc, cc, date, disposition, embedded, encoding, headers, organization, plain, priority, recipient, replyto, rich, sender, smtpfrom, subject

Inherited from Message (private): _dirty, _processed

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sender, recipient, subject, template, variables={}, **kw)
(Constructor)

source code 
Store the additional template and variable information.
Parameters:
  • template (string) - A dot-path to a valid KID template.
  • variables (dict) - A dictionary containing named variables to pass to the template engine.
Overrides: Message.__init__

_process(self)

source code 
Automatically generate the plain and rich text content.
Overrides: Message._process