-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] mail_post_defer: deferred message posting with queue #1001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works and solve the problem but a second UX-review I don't see clearly the UX, because, this would be problematic for user. We should think about that.
b4a1b62
to
d422346
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Will be interesting if defer time (30 sec on code) could be parametrized? |
The base seems similar to OCA/queue#119 |
Makes sense, although the real time for sending an email will be more about 1:00-1:30 minutes minimum. This defer time is to guarantee that, if you're running the mail queue cron at its minimal cadence (once per minute) and let's say you send a message 3 seconds before it's executed, you always have at least 30s of defer. So, even if you parametrize it, there's no guarantee that messages will be sent in that time. Also, everybody loves this feature in Gmail and other mail clients, but I have never seen an option to configure the deferring time. At most, I see the option to enable it or not. So, chances are that real world users never need to configure this. That's why I decided to hardcode the value. IMHO we can keep it as it is and support the param later if we really see it's needed.
Thanks, I didn't know that module! However IIUC both modules would be complementary.
If you install both, you probably can have the best of both worlds, but I don't see any feature overlap or interdependency. I liked from that one the init hook. I think I'll add one here, because when you install this module, chances are you want to have the mail queue cron as fast as possible. |
- Faster because the email sending doesn't block the UI. - Safer because users can undo mails while they're still not sent. @moduon MT-1579 MT-2480
d422346
to
0d66ab7
Compare
Install hook added. I also added @Shide's suggestion to roadmap, just to keep track of that idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
Functionally Reviewed: Direct message to other user doesn't wait 30s.
This PR has the |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at ce38678. Thanks a lot for contributing to OCA. ❤️ |
This module enhances mail threads by using the mail queue by default.
Without this module, Odoo attempts to notify recipients of your message immediately.
If your mail server is slow or you have many followers, this can mean a lot of time.
Install this module and make Odoo more snappy!
All emails will be kept in the outgoing queue by at least 30 seconds,
giving you some time to re-think what you wrote. During that time,
you can still delete the message and start again.
Usage
To use this module, you need to:
The mail is now in the outgoing mail queue. It will be there for at least 30
seconds. It will be really sent the next time the "Mail: Email Queue Manager"
cron job is executed.
While the message has not been yet sent:
indicating it is still outgoing.
Mails will not be sent.
Configuration
You need to do nothing. The module is configured appropriately out of the box.
However, please notice that the mail queue processing is made by a cron job.
This is normal Odoo behavior, not specific to this module. However, since you
will start using that queue for every message posted by any user in any thread,
you will probably want to increase the that job's frequency.
To do so:
@moduon MT-1579 MT-2480