Ejemplo n.º 1
0
def mail_welcome(user):
  params = {'user':user}
  message = mail.get_mail_message('mail_welcome.txt', **params)
  html_message = mail.get_mail_message('mail_welcome.html', **params)

  subject = "Welcome to %s" % ConfigData.get_configdata('SITE_NAME')
  mail.send_mail(user.email, subject, message, html_message=html_message)
Ejemplo n.º 2
0
def email_contact(name, email, message):
  params = {'name':name, 'email':email, 'message':message}
  message = mail.get_mail_message('mail_contact.txt', **params)
  html_message = mail.get_mail_message('mail_contact.html', **params)
  
  subject = "Contact: %s (%s)" % (name, email)
  for to_mail in ContactMessage.get_mails():
    mail.send_mail(to_mail, subject, message, html_message=html_message)
Ejemplo n.º 3
0
def mail_password_instructions(user, code):
  _link = "http://%s%s" % (settings.DOMAIN, reverse("users_passwordreset", args=[code]))
  params = {'user':user, "link": _link}
  message = mail.get_mail_message('mail_password_instructions.txt', **params)
  html_message = mail.get_mail_message('mail_password_instructions.html', **params)

  subject = "Reset your %s password" % settings.SITE_NAME

  mail.send_mail(user.email, subject, message, html_message=html_message)
Ejemplo n.º 4
0
def mail_confirm(user, mail):
  _link = "http://%s%s" % (settings.DOMAIN, reverse("users_validate_email", args=[code]))
  params = {'user':user, "link": _link}
  message = mail.get_mail_message('mail_validate_email.txt', **params)
  html_message = mail.get_mail_message('mail_validate_email.html', **params)

  subject = "Confirm your %s account" % ConfigData.get_configdata('SITE_NAME')
  
  mail.send_mail(user.email, subject, message, html_message=html_message)
Ejemplo n.º 5
0
def send_mail(request, key):
  logging.info("**** common.common_views.send_mail")
  if key == settings.TASKS_KEY and request.method == 'POST':
    _mail = request.POST.get("mail")
    subject = request.POST.get("subject")
    message = request.POST.get("message")
    html_message = request.POST.get("html_message")
    mail.send_mail(_mail, subject, message, html_message=html_message)
    return http.HttpResponse('success')
  return http.HttpResponse('error', status=500)