diff --git a/pandora/user/templates/contact_email.txt b/pandora/user/templates/contact_email.txt index b300f1ba..f50c8bfa 100644 --- a/pandora/user/templates/contact_email.txt +++ b/pandora/user/templates/contact_email.txt @@ -1,5 +1,7 @@ -{{name}} <{{email}}> sent a contact message: +From: {{name}} <{{email}}> +Subject: {{subject}} + {{message}} --- -{{sitename}} +-- +{{sitename}} - {{url}} diff --git a/pandora/user/templates/contact_receipt.txt b/pandora/user/templates/contact_receipt.txt index 99e5f4be..a2f4b159 100644 --- a/pandora/user/templates/contact_receipt.txt +++ b/pandora/user/templates/contact_receipt.txt @@ -1,7 +1,8 @@ -{{name}}, -thanks for your message, we will get back to you shortly. -here your message for forther reference +From: {{name}} <{{from}}> +To: {{sitename}} <{{to}}> +Subject: {{subject}} + {{message}} --- -{{sitename}} +-- +{{sitename}} - {{url}} diff --git a/pandora/user/templates/password_reset_email.txt b/pandora/user/templates/password_reset_email.txt index d0d748b0..1f39ceca 100644 --- a/pandora/user/templates/password_reset_email.txt +++ b/pandora/user/templates/password_reset_email.txt @@ -2,6 +2,7 @@ To reset your password, please use the following code: {{code}} -If you do not want to reset your password, no further action is required. +If you don't want to reset your password, no further action is required. +-- {{sitename}} - {{url}} diff --git a/pandora/user/views.py b/pandora/user/views.py index f78b3579..f9c32548 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -278,9 +278,9 @@ def requestToken(request): template = loader.get_template('password_reset_email.txt') context = RequestContext(request, { - 'url': request.build_absolute_uri("/"), 'code': code, 'sitename': settings.SITENAME, + 'url': request.build_absolute_uri('/'), }) message = template.render(context) subject = '%s - Reset Password' % settings.SITENAME @@ -548,18 +548,20 @@ def contact(request): if 'message' in data and data['message'].strip(): email_from = settings.CONFIG['site']['email']['system'] email_to = [settings.CONFIG['site']['email']['contact'], ] + subject = data.get('subject', '').strip() template = loader.get_template('contact_email.txt') context = RequestContext(request, { - 'email': email, - 'message': data['message'].strip(), 'name': name, + 'email': email, + 'subject': subject + 'message': data['message'].strip(), 'sitename': settings.SITENAME, + 'url': request.build_absolute_uri('/'), }) message = template.render(context) - subject = (u'[%s Contact] %s' % (settings.SITENAME, data.get('subject', ''))).strip() response = json_response(text='message sent') try: - send_mail(subject.strip(), message, email_from, email_to) + send_mail(u'[%s Contact] %s' % (settings.SITENAME, subject), message, email_from, email_to) except BadHeaderError: response = json_response(status=400, text='invalid data') if request.user.is_authenticated() \ @@ -567,14 +569,17 @@ def contact(request): and data['receipt']: template = loader.get_template('contact_receipt.txt') context = RequestContext(request, { - 'email': email, - 'message': data['message'].strip(), 'name': name, + 'from': email, 'sitename': settings.SITENAME, + 'to': email_to, + 'subject': subject, + 'message': data['message'].strip(), + 'url': request.build_absolute_uri('/'), }) message = template.render(context) try: - send_mail(subject.strip(), message, email_from, [email]) + send_mail('Fwd: %s' % subject, message, email_from, [email]) except: pass else: