Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
db65ed9
[8.0][ADD] mail_tracking addon (#67)
antespi Jun 14, 2016
f3b0add
[8.0][IMP][mail_tracking] Speed installation time and discard concurr…
antespi Sep 9, 2016
a2113e2
[FIX] Update email_score when email changes
antespi Sep 9, 2016
ce5e932
[MIG] mail_tracking
antespi Sep 9, 2016
9dfa46c
[FIX] mail_tracking: Typo
pedrobaeza Sep 29, 2016
a03ab3d
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
6cb930a
[MIG] mail_tracking: Migrated to 10.0
bouvyd Oct 14, 2016
5e30b1d
[IMP] mail_tracking performance and bounce process (#103)
antespi Oct 14, 2016
24a8089
[IMP] mail_tracking: Allow to define a custom mail_tracking base url
antespi Oct 14, 2016
9005aed
Add access to portal/public user to his own email trackings
antespi Oct 24, 2016
edb18eb
[8.0][FIX][mail_tracking] Use event recipient address to find partner…
antespi Nov 25, 2016
8e0d644
[9.0][FIX][mail_tracking] Control exception when mail_message was rem…
antespi Nov 22, 2016
9ffeca2
[FIX] Sender label is repeated in search fields
antespi Nov 2, 2016
c0287b3
[FIX][9.0] partner buttons view on enterprise
jjscarafia Dec 14, 2016
1bf3a9d
[FIX] mail_tracking: Obtain outgoing server with sudo
pedrobaeza Feb 10, 2017
951cc68
[IMP] Shut mock exceptions up
chienandalu Jul 14, 2017
aa93900
[9.0][IMP] mail_tracking: Improve view with error details
carlosdauden Feb 8, 2017
f82d3ce
[FIX] mail_tracking: bugfixes (#199)
antespi Oct 10, 2017
93b3ba1
IMP mail_tracking performances
eLBati Feb 21, 2018
9bd2a66
[FIX] mail_tracking js could break other modules using chat_manager
ecino Apr 13, 2018
79bdb7f
[MIG] mail_tracking: Migration to 11.0
chienandalu Mar 19, 2018
5fbc56a
Translated using Weblate (French) [ci skip]
didierdonze Jun 18, 2018
0626315
[IMP] mail_tracking: email score performance (#299)
chienandalu Sep 6, 2018
50f7bc4
Fix README.rst images not visible in GitHub and Odoo
bitroniq Sep 18, 2018
19e25f1
[IMP] mail_tracking: Put button box at the end of the view
pedrobaeza Sep 24, 2018
89e27bf
Translated using Weblate (Catalan)
eduardgm Oct 10, 2018
e216148
[MIG] mail_tracking: Migration to 12.0
ernestotejeda Nov 5, 2018
0c4086d
[FIX] mail_tracking: Don't call write inside other write
pedrobaeza Jun 26, 2019
8e69998
[IMP] mail_tracking: Cc
Tardo Jul 3, 2019
58dc846
[MIG] mail_tracking: Adapt Cc to 12.0
Tardo Jul 3, 2019
9485fb1
[FIX] Bug {TypeError: dict.message.hasEmailCc is not a function} duri…
EgorSummer Jul 22, 2019
b9cc8c7
[FIX] mail_tracking: Repeated suggested cc emails
Tardo Jul 22, 2019
acf6c9a
[IMP] mail_tracking: Adapt test to set (not order preserved)
Tardo Jul 22, 2019
8869582
[FIX] mail_tracking: Show correctly blank image
pedrobaeza Jul 24, 2019
f520fc2
Translated using Weblate (Spanish)
eduardgm Aug 4, 2019
450f554
[IMP] mail_tracking: mail.thread filter for tracking errors
chienandalu Jul 5, 2019
51b76e7
[IMP] mail_tracking: Cc name & check if mail is Cc
Tardo Jul 23, 2019
fc299be
[IMP] mail_tracking: Convert 'partner_trackings' to dict
Tardo Aug 12, 2019
f527486
[IMP] mail_tracking: translations
Tardo Aug 12, 2019
8ffee45
[IMP] mail_tracking: Failed Messages to 12.0
Tardo Oct 17, 2019
9bc6e16
[FIX] mail_tracking: Refresh thread widget when sets a message as rev…
Tardo Nov 14, 2019
5a5c9c0
[IMP] mail_tracking: black, isort
Tardo Nov 18, 2019
80e6de9
[MIG] mail_tracking: Migration to 13.0
Tardo Nov 18, 2019
7048de7
[FIX] mail_tracking: Changed injection method for 'failed_message_ids…
Tardo Nov 28, 2019
fcac87c
[FIX] mail_tracking: do not warn not found if already opened
ruuter Mar 30, 2020
e8ef3ad
[IMP] mail_tracking: Store To recipients and omit aliases
Tardo Mar 19, 2020
3e9c9f6
[IMP] mail_tracking: Test 'to' and named emails
Tardo Mar 26, 2020
e4b742f
[IMP] mail_tracking: Ignore catchall
Tardo Apr 16, 2020
6b65c2c
[FIX] re.search will return None when nothing found. So we have to ch…
wpichler Oct 23, 2020
728318f
[FIX] mail_tracking
nmadhoc Jan 21, 2021
aa6e3e5
[IMP] Apply pre-commit changes: Resolve conflicts
Tardo Jan 26, 2021
10732f6
[IMP] mail_tracking: Discuss failed messages: Button and domain + Onl…
Tardo Oct 2, 2020
15c378b
[FIX] mail_tracking: Store cc
Tardo Mar 1, 2021
50913a0
[IMP] mail_tracking: black, isort, prettier
AreebSiddiqiIR May 3, 2021
c55d97f
[MIG] mail_tracking: Migration to 14.0
AreebSiddiqiIR May 3, 2021
daa54c8
[14.0][MIG] mail_tracking
SimoneVagile Jun 25, 2021
98dded6
[FIX] mail_tracking: Modification in unitest.
angelJuaGar Jun 29, 2021
fbb3832
[FIX] mail_tracking: reduce spammy score
Jul 9, 2021
0f4479b
[FIX] mail_tracking: Added restriction on email search.
angelJuaGar Aug 13, 2021
b4b91b3
[FIX] Change operator to 'ilike'
JorgeQuinteros Sep 22, 2021
33b4d92
[PORT] porting js code to comply with OWL
houssine78 Oct 27, 2021
7b0ba7f
[FIX] mail_tracking: use recipient_address to search emails
fernandahf Nov 24, 2021
9860458
[FIX] mail_tracking: change order of inheritance and use return
fernandahf Jan 12, 2022
b20b79d
[IMP] mail_tracking: black, isort, prettier
JasminSForgeFlow Mar 24, 2022
62f227c
[MIG] mail_tracking: Migration to 15.0
JasminSForgeFlow Mar 25, 2022
9c88441
[FIX] mail_tracking: mixed classes
chienandalu Jan 30, 2023
bbfd623
[IMP] mail_tracking_mailgun: mass mailing manual tracking
chienandalu Jan 12, 2023
436e055
[FIX] mail_tracking: process sent events
Oct 11, 2021
0550185
[FIX] mail_tracking: error when filtering by "Sent"
sugapablo Feb 17, 2022
7339f58
[FIX] mail_tracking: permissions
chienandalu Sep 7, 2022
3979672
[IMP] mail_tracking: remove legacy hooks
Jul 27, 2022
c471d7f
[FIX] mail_tracking: js linter warnings
chienandalu Jan 31, 2023
052aa1f
use keyword arguments in build_email to comply with portal tests
jonasbuchholz Feb 9, 2023
b40e4bb
[FIX] mail_tracking: Crash to add malformed emails to recipients sugg…
sergio-teruel Feb 23, 2023
482db9a
[UPD] Update mail_tracking.pot
Mar 23, 2023
8092db4
Fix mail tracking bounce notification not logged
TDu May 3, 2023
13fd162
[FIX] mail_tracking: thread permissions
chienandalu May 9, 2023
058d408
[FIX] mail_tracking: allowed trackings compute
chienandalu May 22, 2023
18f0d28
[IMP] mail_tracking: New config parameter to disable the tracking image
dhx May 29, 2023
af8d725
[FIX] mail_tracking: failed messages in thread
chienandalu Aug 9, 2023
8c0ec38
[MIG] mail_tracking: Migration to 16.0
filoquin Mar 2, 2023
465bb0c
[MIG] mail_tracking: Completed migration to 16.0
payen000 Sep 4, 2023
de9496d
[FIX] mail_tracking: validated mailbox when computing isInFailedDiscuss
payen000 Oct 16, 2023
8b0d177
[16.0][FIX] mail_tracking debug mode error
NiChrDeuse Dec 15, 2023
6a91dd9
[IMP] mail_tracking: Give example that actually works in readme
hbrunn Mar 18, 2024
93d34bc
[FIX] mail_tracking: be closer to what Odoo does in a nodb environment
hbrunn Mar 18, 2024
0bc3598
[IMP] mail_tracking: pre-commit auto fixes
pedrobaeza Jun 11, 2024
e400f06
[MIG] mail_tracking: Migration to 17.0
chienandalu May 14, 2024
d2ecf48
[IMP] Add option to keep aliases in mail tracking
cvinh Jul 26, 2022
af00d8d
mail_tracking: add garbage collection
henrybackman Aug 14, 2024
a5dd56c
[FW] port missing commits from 14.0 to 17.0
trisdoan Oct 3, 2024
583d160
[IMP] mail_tracking: pre-commit auto fixes
trisdoan Oct 3, 2024
c8bbf51
[MIG] mail_tracking: Migration to 18.0
trisdoan Sep 27, 2024
fbbc333
[FIX] mail_tracking: python warning deprecated utcfromtimestamp
augusto-weiss May 21, 2025
7c08528
[FIX] mail_tracking: Apply read restrictions to everyone not being su…
grindtildeath Jun 30, 2025
fbb37cf
[FIX] mail_tracking: missing onUpdate prop
ivantodorovich Sep 4, 2025
d4493a5
[IMP] mail_tracking: remove dead `failure_count` code
ivantodorovich Sep 8, 2025
bfca7ce
[IMP] mail_tracking: create all mail.tracking.email at once
ivantodorovich Sep 8, 2025
dbc3b0d
[IMP] mail_tracking: remove dead mail.tracking.email.event_process me…
ivantodorovich Sep 8, 2025
db7cf49
[IMP] mail_tracking: use env-aware gettext self.env._ everywhere
ivantodorovich Sep 8, 2025
c1b365c
[IMP] mail_tracking: remove redundant ui FailedMessagePanel
ivantodorovich Sep 8, 2025
a83fe7d
[FIX] mail_tracking: ACL verification
remi-filament Oct 22, 2025
25121d8
[FIX] mail_tracking: Prevent error when the SQL result is empty.
carlos-lopez-tecnativa Nov 25, 2025
ce5ef1c
[FIX] mail_tracking: Error on tabs without thread open when marking a…
Dec 23, 2025
9a502e4
[IMP] mail_tracking: pre-commit auto fixes
quoc-pn Feb 3, 2026
6202a3c
[MIG] mail_tracking: Migration to 19.0
quoc-pn Feb 3, 2026
a3f6fd8
[FIX] mail_tracking: Do not hide exception if not managed
ypapouin Jun 18, 2026
de46bff
[FIX] mail_tracking: isolate alias domain test from installed modules
pilarvargas-tecnativa Jun 29, 2026
9c425e0
[FIX] mail_tracking: make message route test compatible with overrides
pilarvargas-tecnativa Jun 29, 2026
e5ade51
[FIX] mail_tracking: complete message route test payload
pilarvargas-tecnativa Jun 29, 2026
d62a1c7
Translated using Weblate (Slovenian)
sysadminmatmoz Jul 14, 2026
16c1025
[IMP] mail_tracking: auto fixes
carlos-lopez-tecnativa Aug 11, 2026
28e8624
[FIX] mail_tracking: do not swallow exceptions in send_email
skanndar Oct 6, 2026
0619f8d
[IMP] mail_tracking: index mail_id
moylop260 Oct 27, 2026
19ab693
[FIX] mail_tracking: honour bypass_access when searching trackings
moylop260 Oct 27, 2026
c0b4d68
[IMP] mail_tracking: index the messages that need action
moylop260 Oct 30, 2026
1debb7d
[IMP] mail_tracking: Add email score search functionality
tarteo Jul 1, 2026
6053f32
[MIG] mail_tracking: Migration to 20.0 and renamed to mail_recipient_…
Oct 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
222 changes: 222 additions & 0 deletions mail_recipient_tracking/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==============
Email tracking
==============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:edb6846623fce419301b88a3366ab43093edff807b0e0c94c2972a8d57b97b5d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
:target: https://github.com/OCA/mail/tree/20.0/mail_recipient_tracking
:alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mail-20-0/mail-20-0-mail_recipient_tracking
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=20.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module shows email notification tracking status for any messages in
mail thread (chatter). Each notified partner will have an intuitive icon
just right to his name.

**Table of contents**

.. contents::
:local:

Installation
============

If you're using a multi-database installation (with or without dbfilter
option) where /web/databse/selector returns a list of more than one
database, then you need to add ``mail_recipient_tracking`` addon to wide
load addons list (by default, only ``web`` addon), setting ``--load``
option. For example, ``--load=web,mail,mail_tracking``

The first update of the module after this index was added creates a
partial index on ``mail_message``
(``mail_message_mail_tracking_needs_action_index``). Later updates do
not build it again: Odoo keeps it while its definition does not change.

On a database with a very large ``mail_message`` table that first build
blocks writes to the table while it runs (13 minutes on 122 million
rows). To avoid the lock, create the index beforehand exactly as the ORM
would, with the comment it stores on it; Odoo compares that comment with
the index definition and keeps the index when they match:

.. code:: sql

CREATE INDEX CONCURRENTLY mail_message_mail_tracking_needs_action_index
ON mail_message (id) WHERE mail_tracking_needs_action IS TRUE;
COMMENT ON INDEX mail_message_mail_tracking_needs_action_index
IS 'INDEX (id) WHERE mail_tracking_needs_action IS TRUE';

Since Odoo 20.0 the core provides a ``mail_tracking`` module (technical
tracking of field values), so this addon has been renamed to
``mail_recipient_tracking``.

Configuration
=============

As there can be scenarios where sending a tracking img in the email body
is not desired, there is a global system parameter
"mail_tracking.tracking_img_disabled" that can be set to True to remove
the tracking img from all outgoing emails. Note that the **Opened**
status will not be available in this case.

Usage
=====

When user sends a message in mail_thread (chatter), for instance in
partner form, then an email tracking is created for each email
notification. Then a status icon will appear just right to name of
notified partner.

These are all available status icons:

|unknown| **Unknown**: No email tracking info available. Maybe this
notified partner has 'Receive Inbox Notifications by Email' == 'Never'

|waiting| **Waiting**: Waiting to be sent

|error| **Error**: Error while sending

|sent| **Sent**: Sent to SMTP server configured

|delivered| **Delivered**: Delivered to final MX server

|opened| **Opened**: Opened by partner

|cc| **Cc**: It's a Carbon-Copy recipient. Partners added in Cc get
their own email, so their status is shown next to the Cc icon. For Cc
email addresses without their own email, the status can't be known, so
only the Cc icon is shown.

|noemail| **No Email**: The partner doesn't have a defined email

|anonuser| **No Partner**: The recipient doesn't have a defined partner

If you want to see all tracking emails and events you can go to

- Settings > Technical > Email > Tracking emails
- Settings > Technical > Email > Tracking events

When the message generates an 'error' status, it will appear on the
'Failed' tab of the messaging menu. Any view with chatter can show the
failed messages too.

- Chatter

|image|

You can use "Failed sent messages" filter present in all views to show
records with messages in failed status and that needs an user action.

- Filter

|image1|

.. |unknown| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/unknown.png
.. |waiting| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/waiting.png
.. |error| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/error.png
.. |sent| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/sent.png
.. |delivered| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/delivered.png
.. |opened| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/opened.png
.. |cc| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/cc.png
.. |noemail| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/no_email.png
.. |anonuser| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/src/img/anon_user.png
.. |image| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/img/failed_message_widget.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/mail/20.0/mail_recipient_tracking/static/img/failed_message_filter.png

Known issues / Roadmap
======================

- Integrate with the core ``mail.notification`` model as it overlaps
with what the ``mail.tracking`` model does. We could add the existing
features on top of that model and save lots of code lines.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/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 <https://github.com/OCA/mail/issues/new?body=module:%20mail_recipient_tracking%0Aversion:%2020.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Antonio Espinosa
- David Vidal
- Ernesto Tejeda
- Rafael Blasco
- Alexandre Díaz

- `Eezee-IT <https://www.eezee-it.com>`__:

- Asma Elferkhsi

- `Vauxoo <https://www.vauxoo.com>`__:

- Agustín Payen Sandoval

- `Trobz <https://www.trobz.com>`__:

- Tris Doan

- `Komit <https://komit-consulting.com>`__:

- Quoc Pham Ngoc

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/mail/tree/20.0/mail_recipient_tracking>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions mail_recipient_tracking/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
34 changes: 34 additions & 0 deletions mail_recipient_tracking/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2016 Tecnativa - Antonio Espinosa
# Copyright 2018 Tecnativa - David Vidal
# Copyright 2018 Tecnativa - Ernesto Tejeda
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Email tracking",
"summary": "Email tracking system for all mails sent",
"version": "20.0.1.0.0",
"category": "Social Network",
"website": "https://github.com/OCA/mail",
"author": ("Tecnativa, Odoo Community Association (OCA)"),
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["mail"],
"data": [
"data/tracking_data.xml",
"security/ir.access.csv",
"views/mail_tracking_email_view.xml",
"views/mail_tracking_event_view.xml",
"views/mail_message_view.xml",
"views/res_partner_view.xml",
"views/res_config_settings.xml",
],
"assets": {
"web.assets_backend": [
"mail_recipient_tracking/static/src/components/**/*",
"mail_recipient_tracking/static/src/core/**/*",
],
},
"demo": ["demo/demo.xml"],
}
2 changes: 2 additions & 0 deletions mail_recipient_tracking/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import main
from . import messaging_menu
78 changes: 78 additions & 0 deletions mail_recipient_tracking/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import base64
import logging
from contextlib import contextmanager

import werkzeug

import odoo
from odoo import SUPERUSER_ID, api, http

from odoo.addons.mail.controllers.mail import MailController

_logger = logging.getLogger(__name__)

BLANK = "R0lGODlhAQABAIAAANvf7wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="


@contextmanager
def db_env(dbname):
if not http.router.db_filter([dbname]):
raise werkzeug.exceptions.BadRequest()
cr = None
if dbname == http.request.db:
cr = http.request.env.cr
if not cr:
cr = odoo.sql_db.db_connect(dbname).cursor()
yield api.Environment(cr, SUPERUSER_ID, {})


class MailTrackingController(MailController):
def _request_metadata(self):
"""Prepare remote info metadata"""
request = http.request.httprequest
return {
"ip": request.remote_addr or False,
"user_agent": request.user_agent or False,
"os_family": request.user_agent.platform or False,
"ua_family": request.user_agent.browser or False,
}

@http.route(
[
"/mail/tracking/open/<string:db>/<int:tracking_email_id>/blank.gif",
(
"/mail/tracking/open/<string:db>"
"/<int:tracking_email_id>/<string:token>/blank.gif"
),
],
type="http",
auth="none",
methods=["GET"],
)
def mail_tracking_open(self, db, tracking_email_id, token=False, **kw):
"""Route used to track mail openned (With & Without Token)"""
metadata = self._request_metadata()
with db_env(db) as env:
try:
tracking_email = (
env["mail.tracking.email"]
.sudo()
.search([("id", "=", tracking_email_id), ("token", "=", token)])
)
if not tracking_email:
_logger.warning(
"MailTracking email '%s' not found", tracking_email_id
)
elif tracking_email.state in ("sent", "delivered"):
tracking_email.event_create("open", metadata)
except Exception as e: # noqa: BLE001
_logger.warning(e)

# Always return GIF blank image
response = werkzeug.wrappers.Response()
response.mimetype = "image/gif"
response.data = base64.b64decode(BLANK)
return response
13 changes: 13 additions & 0 deletions mail_recipient_tracking/controllers/messaging_menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.fields import Domain

from odoo.addons.mail.controllers.messaging_menu import MessagingMenuController


class MailTrackingMessagingMenuController(MessagingMenuController):
def _get_menu_tab_domain(self, tab_id):
"""Failed messages of the current user, shown in the messaging menu"""
if tab_id == "failed":
return Domain("is_failed_message", "=", True)
return super()._get_menu_tab_domain(tab_id)
13 changes: 13 additions & 0 deletions mail_recipient_tracking/data/tracking_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record
id="decimal_tracking_timestamp"
forcecreate="True"
model="decimal.precision"
>
<field name="name">MailTracking Timestamp</field>
<field name="digits">6</field>
</record>
</odoo>
Loading
Loading