From e24a32d329f12129beeb97f4631aeedf71b5e5c0 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Sun, 8 May 2011 20:32:02 -0400 Subject: [PATCH] Cleaning up from address in shared stories. --- apps/reader/views.py | 6 ++++-- templates/mail/email_story_text.xhtml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/reader/views.py b/apps/reader/views.py index 6066e48c5..1418a3674 100644 --- a/apps/reader/views.py +++ b/apps/reader/views.py @@ -974,7 +974,7 @@ def send_story_email(request): from_name = request.POST['from_name'] from_email = request.POST['from_email'] comments = request.POST['comments'] - from_email = 'share@newsblur.com' + from_address = 'share@newsblur.com' if not email_re.match(to_address): code = -1 @@ -986,7 +986,9 @@ def send_story_email(request): text = render_to_string('mail/email_story_text.xhtml', locals()) html = render_to_string('mail/email_story_html.xhtml', locals()) subject = "%s is sharing a story with you: \"%s\"" % (from_name, story['story_title']) - msg = EmailMultiAlternatives(subject, text, from_email, [to_address], + msg = EmailMultiAlternatives(subject, text, + from_email=['NewsBlur <%s>' % from_address], + to=[to_address], cc=['%s <%s>' % (from_name, from_email)], headers={'Reply-To': '%s <%s>' % (from_name, from_email)}) msg.attach_alternative(html, "text/html") diff --git a/templates/mail/email_story_text.xhtml b/templates/mail/email_story_text.xhtml index f1d6d0c94..f15a23fbc 100644 --- a/templates/mail/email_story_text.xhtml +++ b/templates/mail/email_story_text.xhtml @@ -2,7 +2,7 @@ Hello there! {{ from_name }} is sharing a story with you entitled "{{ story.stor {% if comments %} {{ from_name }} writes: -"{{ comments }}" +{{ comments }} {% endif %} --