Subversion Repositories SmartDukaan

Rev

Rev 494 | Rev 766 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 494 Rev 581
Line 16... Line 16...
16
 
16
 
17
from shop2020.thriftpy.utils.ttypes import Message as Msg
17
from shop2020.thriftpy.utils.ttypes import Message as Msg
18
from string import Template
18
from string import Template
19
import datetime
19
import datetime
20
from shop2020.helpers.impl import DataService
20
from shop2020.helpers.impl import DataService
-
 
21
from email.mime.text import MIMEText
21
 
22
 
22
def initialize():
23
def initialize():
23
    log_entry("initialize@DataAccessor", "Initializing data service")
24
    log_entry("initialize@DataAccessor", "Initializing data service")
24
    DataService.initialize()
25
    DataService.initialize()
25
    
26
    
26
def sendMail(mail):
27
def sendMail(mail):
27
    if not mail:
28
    if not mail:
28
        raise HelperServiceException(101, "mail not present")
29
        raise HelperServiceException(101, "mail not present")
29
    msg = MIMEMultipart()
30
    #msg = MIMEMultipart()
30
    mail = Mail()
31
    #mail = Mail()
-
 
32
    msg = MIMEText(mail.data)
31
    msg['From'] = mail.sender
33
    msg['From'] = mail.sender
32
    msg['Subject'] = mail.subject
34
    msg['Subject'] = mail.subject
33
    msg.attach(mail.data)
35
    #msg.attach(mail.data)
34
    
36
    
35
    #handle attachments in mail
37
    #handle attachments in mail
36
    if mail.attachments:
38
    if mail.attachments:
37
        for attach in mail.attachments:
39
        for attach in mail.attachments:
38
                   
40