1. illume
  2. newsletter

Commits

illume  committed bab36bc

Fix bug where the resonse for send_message was looking at wrong template var.

  • Participants
  • Parent commits 3353dcb
  • Branches default

Comments (0)

Files changed (1)

File newsletter/newsletterapp/newsletterapp.py

View file
 
         email_body_template = self.send_message_config.get('email_body_template')
         email_subject_template = self.send_message_config.get('email_subject_template')
-        web_front_template = self.send_message_config.get('web_front_template')
+        web_front_response_template = self.send_message_config.get('web_front_response_template')
         
         toaddr = self.send_message_config.get('toaddr', '')
 
         # We get the toaddr from the kwargs if it is set to None in the header
         if toaddr is None:
-            toaddr = kwargs.get('toaddr')
-            if not validate_email(toaddr):
+            toaddr = kwargs.get('toaddr', None)
+            if toaddr is None or not validate_email(toaddr):
                 raise ValueError("toaddr invalid")
         
         if toaddr == '':
                 self.config.get('sendmail_cmd'),
                 )
         
-        return self.web_newsletter.html_template(web_front_template, wrap_it)
+        return self.web_newsletter.html_template(web_front_response_template, wrap_it)
         
         
     def validate_input(self, kwargs):