Commits

Luke Plant committed 78cf038 Merge

Merged from default

  • Participants
  • Parent commits 46dd057, 9c6aafc
  • Branches live

Comments (0)

Files changed (2)

cciw/cciwmain/tests/contact.py

                                                    subject="general"))
         self.assertEqual(len(mail.outbox), 1)
         self.assertEqual(mail.outbox[0].to, [settings.FEEDBACK_EMAIL])
+        self.assertEqual(mail.outbox[0].extra_headers['Reply-To'], 'validemail@somewhere.com')
 
     def test_send_to_booking_secretary(self):
         self.client.post(FEEDBACK_URL,

cciw/cciwmain/views/misc.py

 
 def send_feedback(to_emails, from_email, name, message):
     message = wrap(message, 70)
-    mail.send_mail("CCIW website feedback", """
+    email = mail.EmailMessage(subject="CCIW website feedback",
+                              body="""
 The following message has been sent on the CCIW website feedback form:
 
 From: %(name)s
 Message:
 %(message)s
 
-""" % locals(), settings.SERVER_EMAIL, to_emails)
+""" % locals(),
+                              from_email=settings.SERVER_EMAIL,
+                              to=to_emails,
+                              headers={'Reply-To': from_email})
+    email.send()
 
 CONTACT_CHOICE_GENERAL = 'general'
 CONTACT_CHOICE_WEBSITE = 'website'