From e9c28faa51a693c769f7f9e11132f660ccc713f3 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Wed, 19 Sep 2012 16:33:46 -0600 Subject: added html email to authopenid --- askbot/deps/django_authopenid/views.py | 8 ++++---- .../templates/authopenid/email_validation.html | 20 ++++++++++++++++++++ .../common/templates/authopenid/email_validation.txt | 14 -------------- 3 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 askbot/skins/common/templates/authopenid/email_validation.html delete mode 100644 askbot/skins/common/templates/authopenid/email_validation.txt diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index 5498c792..e5c7df6c 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -46,7 +46,7 @@ from django.utils.encoding import smart_unicode from django.utils.html import escape from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe -from django.core.mail import send_mail +from askbot.mail import send_mail from recaptcha_works.decorators import fix_recaptcha_remote_ip from askbot.skins.loaders import render_into_skin, get_template from askbot.deps.django_authopenid.ldap_auth import ldap_create_user @@ -385,7 +385,7 @@ def signin(request, template_name='authopenid/signin.html'): user_info = ldap_authenticate(username, password) if user_info['success']: if askbot_settings.LDAP_AUTOCREATE_USERS: - #create new user or + #create new user or user = ldap_create_user(user_info).user user = authenticate(method='force', user_id=user.id) assert(user is not None) @@ -404,7 +404,7 @@ def signin(request, template_name='authopenid/signin.html'): user_info['last_name'] return finalize_generic_signin( request, - login_provider_name = 'ldap', + login_provider_name = 'ldap', user_identifier = ldap_username + '@ldap', redirect_url = next_url ) @@ -1179,7 +1179,7 @@ def send_email_key(email, key, handler_url_name='user_account_recover'): reverse(handler_url_name) +\ '?validation_code=' + key } - template = get_template('authopenid/email_validation.txt') + template = get_template('authopenid/email_validation.html') message = template.render(data) send_mail(subject, message, django_settings.DEFAULT_FROM_EMAIL, [email]) diff --git a/askbot/skins/common/templates/authopenid/email_validation.html b/askbot/skins/common/templates/authopenid/email_validation.html new file mode 100644 index 00000000..616b285f --- /dev/null +++ b/askbot/skins/common/templates/authopenid/email_validation.html @@ -0,0 +1,20 @@ +{% extends "email/base_mail.html"%} +{% block title %}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%} +{% block headline%}{% trans %}Greetings from the Q&A forum{% endtrans %},{%endblock%} + +{%block content%} + +

{% trans %}To make use of the Forum, please follow the link below:{% endtrans %}

+ +

{{validation_link}}

+ +

{% trans %}Following the link above will help us verify your email address.{% endtrans %}

+ +

{% trans %}If you believe that this message was sent in mistake - +no further action is needed. Just ignore this email, we apologize +for any inconvenience{% endtrans %}

+{%endblock%} + +{%block footer %} +{% include "email/footer.html" %} +{% endblock %} diff --git a/askbot/skins/common/templates/authopenid/email_validation.txt b/askbot/skins/common/templates/authopenid/email_validation.txt deleted file mode 100644 index bd68c61a..00000000 --- a/askbot/skins/common/templates/authopenid/email_validation.txt +++ /dev/null @@ -1,14 +0,0 @@ -{% trans %}Greetings from the Q&A forum{% endtrans %}, - -{% trans %}To make use of the Forum, please follow the link below:{% endtrans %} - -{{validation_link}} - -{% trans %}Following the link above will help us verify your email address.{% endtrans %} - -{% trans %}If you believe that this message was sent in mistake - -no further action is needed. Just ignore this email, we apologize -for any inconvenience{% endtrans %} - -{% trans %}Sincerely, -Q&A Forum Administrator{% endtrans %} -- cgit v1.2.3-1-g7c22