mail.py
changeset 7894 ad0eeb0f7a8d
parent 7879 9aae456abab5
child 8056 8909800a8c51
equal deleted inserted replaced
7889:6cebeb1f386a 7894:ad0eeb0f7a8d
    19 
    19 
    20 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    21 
    21 
    22 from base64 import b64encode, b64decode
    22 from base64 import b64encode, b64decode
    23 from time import time
    23 from time import time
    24 from email.MIMEMultipart import MIMEMultipart
    24 from email.mime.multipart import MIMEMultipart
    25 from email.MIMEText import MIMEText
    25 from email.mime.text import MIMEText
    26 from email.MIMEImage import MIMEImage
    26 from email.mime.image import MIMEImage
    27 from email.Header import Header
    27 from email.header import Header
    28 try:
    28 try:
    29     from socket import gethostname
    29     from socket import gethostname
    30 except ImportError:
    30 except ImportError:
    31     def gethostname(): # gae
    31     def gethostname(): # gae
    32         return 'XXX'
    32         return 'XXX'
   153     notification)
   153     notification)
   154     """
   154     """
   155     # XXX refactor this class to work with len(rset) > 1
   155     # XXX refactor this class to work with len(rset) > 1
   156 
   156 
   157     msgid_timestamp = True
   157     msgid_timestamp = True
       
   158 
       
   159     # to be defined on concrete sub-classes
       
   160     content = None # body of the mail
       
   161     message = None # action verb of the subject
   158 
   162 
   159     # this is usually the method to call
   163     # this is usually the method to call
   160     def render_and_send(self, **kwargs):
   164     def render_and_send(self, **kwargs):
   161         """generate and send an email message for this view"""
   165         """generate and send an email message for this view"""
   162         delayed = kwargs.pop('delay_to_commit', None)
   166         delayed = kwargs.pop('delay_to_commit', None)