Documentation: Add pickle serializer requirement
andresriancho opened this issue · 2 comments
andresriancho commented
Add documentation text explaining that this module only works if the CELERY_TASK_SERIALIZER
is pickle. Otherwise the pickling of email messages fails:
>>> from django.core.mail import EmailMessage
>>> e = EmailMessage('a', 'b', 'c@d.com')
>>> import json
>>> json.dumps(e)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python2.7/json/encoder.py", line 178, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <django.core.mail.message.EmailMessage object at 0x3f95c10> is not JSON serializable
>>>
andresriancho commented
Or even better, merge these changes where it is fixed
andresriancho commented
Or even better, my fork which supports HTML email
https://github.com/andresriancho/django-celery-email/commits/master