Comments (6)
I'm going to re-open this, for the sake of anyone searching for the issue, although I don't intend to do anything about it in django-mailer itself.
from django-mailer.
It's not at all clear to me that this is a bug in django-mailer. It rather looks like a bug in "templated_mail" due to it creating EmailMessage objects in some non standard way that means they can't be pickled.
If you can provide a reduced test case that shows an issue in django-mailer that would be helpful.
from django-mailer.
@spookylukey thanks for replying.
This is what Djoser uses django-templated-mail and It works only when I remove the request https://github.com/pawanpaudel93/django-mailer/blob/master/src/mailer/models.py#L94 while pickling the email on django-mailer. So, there is a problem picking the request. Can you take a look at why the pickling error is occurring ?? @spookylukey
from django-mailer.
OK, it's like I thought. templated_mail
is adding extra stuff to the EmailMessage
instances, things that can't be pickled (like HttpRequest
objects). django-mailer needs to pickle the EmailMessage
object, so that is incompatible.
You need to file a bug with templated_mail
and see if there is a way for them to do it without adding that attribute. There is no reason for EmailMessage
objects to have the request
attached to them, that's sounds like a bad design decision to me. An email class shouldn't have access to HttpRequest
objects, it's a layering violation, because sending email has got nothing to do with processing HTTP requests. You should rather separate those activities - you should have a function/class that prepares the content of the email (which may use request
if you really want), and then passes it on to the EmailMessage
constructor. There is no need to subclass EmailMessage
in this case.
from django-mailer.
@spookylukey Thank you very much for your time and help and also thanks for the great Django app.
from django-mailer.
See sunscrapers/django-templated-mail#29 which may resolve the issue.
from django-mailer.
Related Issues (20)
- What is the purpose of send_loop HOT 3
- Allow setting priority without using django-mailer specific functions
- Please start with the "why?" and the benefits HOT 2
- Condense logging HOT 2
- send_loop busy loops when there are deferred messages HOT 1
- TypeError sequence item 1: expected str instance, NoneType found HOT 5
- Forecast for the next deploy? HOT 7
- Fix issue with BigAutoField
- More granular control of how many emails to send. HOT 1
- use unittest.mock instead of mock HOT 2
- How to access subject line from db HOT 4
- Stop retrying/deferring after n failures HOT 1
- Hello HOT 2
- lockfile dependency is deprecated
- Webmail Smtp HOT 3
- feature request: release email(s) from admin under interface under Message actions HOT 2
- Issue running runmailer_pg HOT 1
- Define your own database table for the email queue HOT 3
- Ability to disable message logs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-mailer.