def sendEventNotification(subject, body=''): html_body = body.replace('\n', '<br />') mailman.sendOneWayMail('"Jobhunt Admin" <*****@*****.**>', ['*****@*****.**'], subject, html_body, text_message=body)
def sendWithDjangoTemplate(to_email, subject, parameters, html_filename, sender=None): if not sender: sender='"Jobhunt.in" <*****@*****.**>' template_dir = '/apps/jobhuntin/backslash/mailtemplates/' html_filename = template_dir + html_filename template_html = open(html_filename, 'r').read() html_body = django_templater.render(template_html, parameters) mailman.sendOneWayMail(sender, [to_email], subject, html_body)
def sendWithTemplate(to_email, subject, parameters, html_filename, txt_filename): sender='"Jobhunt.in" <*****@*****.**>' template_dir = '/apps/jobhuntin/backslash/mailtemplates/' html_filename = template_dir + html_filename txt_filename = template_dir + txt_filename template_html = open(html_filename, 'r').read() template_text = open(txt_filename, 'r').read() html_body = Template(template_html).safe_substitute(parameters) text_body = Template(template_text).safe_substitute(parameters) mailman.sendOneWayMail(sender, [to_email], subject, html_body, text_message=text_body)
def sendEventNotification(subject, body=''): html_body = body.replace('\n','<br />') mailman.sendOneWayMail('"Jobhunt Admin" <*****@*****.**>', ['*****@*****.**'], subject, html_body, text_message=body)