emencia / emencia-django-newsletter

An app for sending newsletter by email to a contact list.
189 stars 72 forks source link

Small fix for proper "To" field encoding #55

Open nnseva opened 12 years ago

nnseva commented 12 years ago
--- emencia/django/newsletter/models.py.orig
+++ emencia/django/newsletter/models.py
@@ -126,7 +126,7 @@

     def mail_format(self):
         if self.first_name and self.last_name:
-            return '%s %s <%s>' % (self.last_name, self.first_name, self.email)
+            return '"%s %s" <%s>' % (unicode(self.last_name).encode('utf-8'), unicode(self.first_name).encode('utf-8'), unicode(self.email).encode('utf-8'))
         return self.email
     mail_format.short_description = _('mail format')
xaralis commented 12 years ago

Please, incorporate this as soon as possible, I have had just the same problem and it wasn't really easy to find out whats wrong.