This module extends the functionality of Odoo's mail notification system to allow forcing email notifications through context keys. By default, Odoo sends internal notifications to connected users and email notifications to external partners or disconnected users.
With this module, you can override this behavior by setting the
force_notification_by_email context key, ensuring specific
notifications are always sent by email regardless of the user's
connection status or notification preferences. This is particularly
useful when you need to maintain an email trail for certain
communications or ensure critical notifications are delivered via email.
Table of contents
To use this module, you need to:
For developers implementing the feature:
- Add the context key
force_notification_by_email=Truewhen sending messages through the mail thread
self.env['mail.thread'].with_context( force_notification_by_email=True ).message_post( body="Your message", partner_ids=[partner.id], )
- Add the context key
For end users:
- No specific configuration is needed
- When developers have implemented the feature in specific actions:
- Messages will be sent by email regardless of your notification preferences
- You will receive email notifications even if you are connected to Odoo
- Your notification preferences in your user settings won't affect these specific notifications
Example Use Cases:
- Critical notifications that need email documentation
- Automated workflows where email trail is required
- Compliance requirements where email proof of communication is necessary
Note: This module only affects notifications where the context key has been specifically implemented. All other notifications will follow standard Odoo behavior.
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
- Camptocamp
-
- Rafael Lima <rafael.lima@camptocamp.com>
The development of this module has been financially supported by Camptocamp.
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/mail project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.




