Context key to define notifications to be sent by emaildefined by force_notification_by_email context key
Project description
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
Usage
To use this module, you need to:
For developers implementing the feature:
Add the context key force_notification_by_email=True when 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], )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.
Bug Tracker
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.
Credits
Contributors
-
Rafael Lima <rafael.lima@camptocamp.com>
Other credits
The development of this module has been financially supported by Camptocamp.
Maintainers
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_mail_force_email_notification-18.0.1.0.0.2-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_mail_force_email_notification-18.0.1.0.0.2-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dfb973cd07290060adaefd1f5e91cc94bb7089742d5f45e36e5f587af1dd71b
|
|
| MD5 |
85c5f167e11a856653c78572cd68dd82
|
|
| BLAKE2b-256 |
f07ff1ed60326a8ede6aafb1f43a587b76aafa49c37a352af6225e95dddf5667
|