Skip to content
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

[16.0][MIG] mail_tracking: Migration to 16.0 #1216

Merged
merged 163 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
0ddcb83
[8.0][ADD] mail_tracking addon (#67)
antespi Jun 14, 2016
a8b8a25
[8.0][IMP][mail_tracking] Speed installation time and discard concurr…
antespi Sep 9, 2016
59001b4
[FIX] Update email_score when email changes
antespi Sep 9, 2016
be49279
[MIG] mail_tracking
antespi Sep 9, 2016
cf37bee
[FIX] mail_tracking: Typo
pedrobaeza Sep 29, 2016
7aaabd6
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
dcee7f8
[MIG] mail_tracking: Migrated to 10.0
bouvyd Oct 14, 2016
d9e6e65
[IMP] mail_tracking performance and bounce process (#103)
antespi Oct 14, 2016
4dce9c0
[IMP] mail_tracking: Allow to define a custom mail_tracking base url
antespi Oct 14, 2016
fc64f5c
Add access to portal/public user to his own email trackings
antespi Oct 24, 2016
12b34c5
[8.0][FIX][mail_tracking] Use event recipient address to find partner…
antespi Nov 25, 2016
7c9aabe
[9.0][FIX][mail_tracking] Control exception when mail_message was rem…
antespi Nov 22, 2016
e662b4b
[FIX] Sender label is repeated in search fields
antespi Nov 2, 2016
a185584
[FIX][9.0] partner buttons view on enterprise
jjscarafia Dec 14, 2016
a564869
[FIX] mail_tracking: Obtain outgoing server with sudo
pedrobaeza Feb 10, 2017
1898bb1
[IMP] Shut mock exceptions up
chienandalu Jul 14, 2017
f0aff3b
[9.0][IMP] mail_tracking: Improve view with error details
carlosdauden Feb 8, 2017
5987c3f
[FIX] mail_tracking: bugfixes (#199)
antespi Oct 10, 2017
210de91
IMP mail_tracking performances
eLBati Feb 21, 2018
458e72d
[FIX] mail_tracking js could break other modules using chat_manager
ecino Apr 13, 2018
715618f
[MIG] mail_tracking: Migration to 11.0
chienandalu Mar 19, 2018
7121b1f
Translated using Weblate (French) [ci skip]
didierdonze Jun 18, 2018
c2eda72
[IMP] mail_tracking: email score performance (#299)
chienandalu Sep 6, 2018
97d6069
Fix README.rst images not visible in GitHub and Odoo
bitroniq Sep 18, 2018
8e652c4
[IMP] mail_tracking: Put button box at the end of the view
pedrobaeza Sep 24, 2018
3348f98
Translated using Weblate (Catalan)
eduardgm Oct 10, 2018
d6d4142
[MIG] mail_tracking: Migration to 12.0
ernestotejeda Nov 5, 2018
d324aa1
[FIX] mail_tracking: Don't call write inside other write
pedrobaeza Jun 26, 2019
2706977
[IMP] mail_tracking: Cc
Tardo Jul 3, 2019
592b9d1
[MIG] mail_tracking: Adapt Cc to 12.0
Tardo Jul 3, 2019
2784925
mail_tracking 12.0.1.1.0
OCA-git-bot Jul 19, 2019
3e2fc69
[FIX] Bug {TypeError: dict.message.hasEmailCc is not a function} duri…
EgorSummer Jul 22, 2019
15a5a2a
mail_tracking 12.0.1.1.1
OCA-git-bot Jul 22, 2019
40c3129
[FIX] mail_tracking: Repeated suggested cc emails
Tardo Jul 22, 2019
a4ab91b
[IMP] mail_tracking: Adapt test to set (not order preserved)
Tardo Jul 22, 2019
d93ff00
mail_tracking 12.0.1.1.2
OCA-git-bot Jul 22, 2019
c11f78f
[FIX] mail_tracking: Show correctly blank image
pedrobaeza Jul 24, 2019
1fd5ec8
Translated using Weblate (Spanish)
eduardgm Aug 4, 2019
8a52d2a
[IMP] mail_tracking: mail.thread filter for tracking errors
chienandalu Jul 5, 2019
8ef81f2
[IMP] mail_tracking: Cc name & check if mail is Cc
Tardo Jul 23, 2019
ce8f865
[IMP] mail_tracking: Convert 'partner_trackings' to dict
Tardo Aug 12, 2019
17f8d93
[IMP] mail_tracking: translations
Tardo Aug 12, 2019
8100ec4
[IMP] mail_tracking: Failed Messages to 12.0
Tardo Oct 17, 2019
064c793
mail_tracking 12.0.2.0.0
OCA-git-bot Nov 13, 2019
107bf80
[FIX] mail_tracking: Refresh thread widget when sets a message as rev…
Tardo Nov 14, 2019
3ff53ab
mail_tracking 12.0.2.0.1
OCA-git-bot Nov 17, 2019
6b980a5
[IMP] mail_tracking: black, isort
Tardo Nov 18, 2019
4acc95a
[MIG] mail_tracking: Migration to 13.0
Tardo Nov 18, 2019
3b0f4d8
[UPD] Update mail_tracking.pot
oca-travis Feb 5, 2020
99ff431
[UPD] README.rst
OCA-git-bot Feb 5, 2020
e9b446a
[UPD] Update mail_tracking.pot
oca-travis Feb 10, 2020
683851b
Update translation files
oca-transbot Feb 10, 2020
25a6f0a
[FIX] mail_tracking: Changed injection method for 'failed_message_ids…
Tardo Nov 28, 2019
de609a3
mail_tracking 13.0.1.0.1
OCA-git-bot Feb 24, 2020
6b39838
[UPD] README.rst
OCA-git-bot Mar 29, 2020
a4979ed
[FIX] mail_tracking: do not warn not found if already opened
ruuter Mar 30, 2020
17cd59e
mail_tracking 13.0.1.0.2
OCA-git-bot Apr 1, 2020
7a09950
[IMP] mail_tracking: Store To recipients and omit aliases
Tardo Mar 19, 2020
2f3fc11
[IMP] mail_tracking: Test 'to' and named emails
Tardo Mar 26, 2020
e88edb9
[UPD] Update mail_tracking.pot
oca-travis Apr 22, 2020
7156f27
mail_tracking 13.0.1.0.3
OCA-git-bot Apr 22, 2020
0987c69
Update translation files
oca-transbot Apr 22, 2020
104ea90
[IMP] mail_tracking: Ignore catchall
Tardo Apr 16, 2020
ad10ce8
[UPD] Update mail_tracking.pot
oca-travis Apr 23, 2020
1aab576
mail_tracking 13.0.1.0.4
OCA-git-bot Apr 23, 2020
5a67189
Update translation files
oca-transbot Apr 23, 2020
7ceee29
Update translation files
oca-transbot Aug 16, 2020
d82bff7
[UPD] Update mail_tracking.pot
oca-travis Nov 17, 2020
e7d55e3
Update translation files
oca-transbot Nov 17, 2020
8c51374
[FIX] re.search will return None when nothing found. So we have to ch…
wpichler Oct 23, 2020
6c742b5
[FIX] mail_tracking
nmadhoc Jan 21, 2021
c3ef63b
mail_tracking 13.0.1.0.6
OCA-git-bot Jan 21, 2021
ffa5571
[IMP] pre-commit run -a
Jan 26, 2021
f073590
[IMP] Apply pre-commit changes: Resolve conflicts
Tardo Jan 26, 2021
f0bba01
[FIX] pre-commit run -a
Jan 27, 2021
98778b3
[IMP] mail_tracking: Discuss failed messages: Button and domain
Tardo Oct 2, 2020
615edd0
[IMP] mail_tracking: Discuss failed messages: Only show confirmation …
Tardo Feb 1, 2021
21012d6
[UPD] Update mail_tracking.pot
oca-travis Feb 2, 2021
170caa2
mail_tracking 13.0.1.0.7
OCA-git-bot Feb 2, 2021
0ea24c9
Update translation files
oca-transbot Feb 2, 2021
c1499d8
[FIX] mail_tracking: Store cc
Tardo Mar 1, 2021
0cd6200
mail_tracking 13.0.1.0.8
OCA-git-bot Mar 9, 2021
5a096c4
[IMP] mail_tracking: black, isort, prettier
AreebSiddiqiIR May 3, 2021
97cbeda
[MIG] mail_tracking: Migration to 14.0
AreebSiddiqiIR May 3, 2021
9f5a34a
[14.0][MIG] mail_tracking
SimoneVagile Jun 25, 2021
a5b00f7
[FIX] mail_tracking: Modification in unitest.
angelJuaGar Jun 29, 2021
2367f3f
[UPD] Update mail_tracking.pot
oca-travis Jun 30, 2021
d4b3a78
[UPD] README.rst
OCA-git-bot Jun 30, 2021
28a5449
[FIX] mail_tracking: reduce spammy score
Jul 9, 2021
4a5b2a6
[FIX] mail_tracking: Added restriction on email search.
angelJuaGar Aug 13, 2021
a98f089
mail_tracking 14.0.1.1.0
OCA-git-bot Aug 13, 2021
12562dd
[FIX] Change operator to 'ilike'
JorgeQuinteros Sep 22, 2021
d98247b
mail_tracking 14.0.1.1.1
OCA-git-bot Oct 4, 2021
5011a58
[UPD] Update mail_tracking.pot
oca-travis Oct 5, 2021
27cdbfc
Update translation files
oca-transbot Oct 5, 2021
c1138b0
[UPD] Update mail_tracking.pot
oca-travis Oct 13, 2021
998b51f
Update translation files
oca-transbot Oct 13, 2021
ec8b389
[PORT] porting js code to comply with OWL
houssine78 Oct 27, 2021
efe3dcb
[UPD] Update mail_tracking.pot
oca-travis Nov 11, 2021
73a6446
Update translation files
oca-transbot Nov 11, 2021
2c35e9b
[PEP8] pre-commit
houssine78 Nov 8, 2021
ccd0503
[UPD] Update mail_tracking.pot
oca-travis Nov 11, 2021
d148af0
[UPD] README.rst
OCA-git-bot Nov 11, 2021
e005608
mail_tracking 14.0.2.0.0
OCA-git-bot Nov 11, 2021
e95c476
Update translation files
oca-transbot Nov 11, 2021
24a9f4a
[FIX] mail_tracking: use recipient_address to search emails
fernandahf Nov 24, 2021
04b059a
[UPD] Update mail_tracking.pot
oca-travis Jan 13, 2022
c024f09
mail_tracking 14.0.2.0.1
OCA-git-bot Jan 13, 2022
c92249d
Update translation files
oca-transbot Jan 13, 2022
02203de
[FIX] mail_tracking: change order of inheritance and use return
fernandahf Jan 12, 2022
3f894af
mail_tracking 14.0.2.0.2
OCA-git-bot Jan 18, 2022
90d158f
[IMP] mail_tracking: black, isort, prettier
JasminSForgeFlow Mar 24, 2022
e8b450d
[MIG] mail_tracking: Migration to 15.0
JasminSForgeFlow Mar 25, 2022
9dfa28a
[UPD] Update mail_tracking.pot
May 11, 2022
fb18d20
[UPD] README.rst
OCA-git-bot May 11, 2022
8df1d99
mail_tracking 15.0.1.0.1
OCA-git-bot May 11, 2022
921f5eb
Fixed Deprecated Warning
Aug 23, 2022
06244fe
mail_tracking 15.0.1.0.2
OCA-git-bot Aug 23, 2022
c12a553
[UPD] Update mail_tracking.pot
Aug 30, 2022
9c98cea
Update translation files
oca-transbot Aug 30, 2022
afe6220
[FIX] mail_tracking: mixed classes
chienandalu Jan 30, 2023
8b78a72
[IMP] mail_tracking_mailgun: mass mailing manual tracking
chienandalu Jan 12, 2023
003ee3e
[FIX] mail_tracking: process sent events
Oct 11, 2021
cfda85a
[FIX] mail_tracking: error when filtering by "Sent"
sugapablo Feb 17, 2022
7165e48
[FIX] mail_tracking: permissions
chienandalu Sep 7, 2022
60ab6f7
[IMP] mail_tracking: remove legacy hooks
StephaneMangin Jul 27, 2022
434ba35
[UPD] Update mail_tracking.pot
Jan 31, 2023
4f13651
mail_tracking 15.0.1.1.0
OCA-git-bot Jan 31, 2023
3d5e49f
Update translation files
weblate Jan 31, 2023
764e094
[FIX] mail_tracking: js linter warnings
chienandalu Jan 31, 2023
e6682d4
[UPD] Update mail_tracking.pot
Feb 2, 2023
3621a7d
mail_tracking 15.0.2.0.0
OCA-git-bot Feb 2, 2023
54ff0b3
Update translation files
weblate Feb 2, 2023
9bb48ba
use keyword arguments in build_email to comply with portal tests
jonasbuchholz Feb 9, 2023
e789ac6
mail_tracking 15.0.2.0.1
OCA-git-bot Feb 12, 2023
960a23f
[FIX] mail_tracking: Crash to add malformed emails to recipients sugg…
sergio-teruel Feb 23, 2023
75bd345
mail_tracking 15.0.2.0.2
OCA-git-bot Mar 1, 2023
4e3dd4d
Translated using Weblate (Italian)
mymage Mar 23, 2023
9fe9f2d
[UPD] Update mail_tracking.pot
Mar 23, 2023
0a13c84
Update translation files
weblate Mar 23, 2023
804ad3a
Translated using Weblate (Italian)
francesco-ooops Apr 7, 2023
17fcd66
Fix mail tracking bounce notification not logged
TDu May 3, 2023
f996458
mail_tracking 15.0.2.0.3
OCA-git-bot May 5, 2023
2316c3f
[FIX] mail_tracking: thread permissions
chienandalu May 9, 2023
869f257
mail_tracking 15.0.2.0.4
OCA-git-bot May 9, 2023
b79c30f
[FIX] mail_tracking: allowed trackings compute
chienandalu May 22, 2023
ee74c7b
mail_tracking 15.0.2.0.5
OCA-git-bot May 22, 2023
e801690
[IMP] mail_tracking: New config parameter to disable the tracking image
dhx May 29, 2023
eaf375e
Translated using Weblate (Italian)
mymage Jun 15, 2023
f4fe5e1
[UPD] README.rst
OCA-git-bot Jun 23, 2023
efc4d50
mail_tracking 15.0.3.0.0
OCA-git-bot Jun 23, 2023
2d0d6a3
mail_tracking 15.0.3.0.1
OCA-git-bot Jul 10, 2023
76cd5eb
[UPD] Update mail_tracking.pot
Jul 18, 2023
a534ad0
Update translation files
weblate Jul 18, 2023
c8fd2a1
[FIX] mail_tracking: failed messages in thread
chienandalu Aug 9, 2023
9ba1a39
[UPD] Update mail_tracking.pot
Aug 10, 2023
781bf09
[UPD] README.rst
OCA-git-bot Aug 10, 2023
158b4d7
mail_tracking 15.0.3.1.0
OCA-git-bot Aug 10, 2023
fdc9b8c
Update translation files
weblate Aug 10, 2023
5ff6ab8
[UPD] README.rst
OCA-git-bot Sep 3, 2023
10f2f95
[IMP] mail_tracking: pre-commit run
payen000 Sep 25, 2023
b3f4068
[MIG] mail_tracking: Migration to 16.0
filoquin Mar 2, 2023
ef73e2d
[MIG] mail_tracking: Completed migration to 16.0
payen000 Sep 4, 2023
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
204 changes: 204 additions & 0 deletions mail_tracking/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
==============
Email tracking
==============

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

.. |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/licence-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%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/15.0/mail_tracking
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_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/social&target_branch=15.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_tracking`` addon to wide load addons list
(by default, only ``web`` addon), setting ``--load`` option.
For example, ``--load=web,mail_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:

.. |sent| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/sent.png
:width: 10px

.. |delivered| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/delivered.png
:width: 15px

.. |opened| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/opened.png
:width: 15px

.. |error| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/error.png
:width: 10px

.. |waiting| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/waiting.png
:width: 10px

.. |unknown| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/unknown.png
:width: 10px

.. |cc| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/cc.png
:width: 10px

.. |noemail| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/no_email.png
:width: 10px

.. |anonuser| image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/src/img/anon_user.png
:width: 10px

|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. Can't know the status so is 'Unknown'

|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 apear on discuss 'Failed'
channel. Any view with chatter can show the failed messages
too.

* Discuss

.. image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/img/failed_message_discuss.png

* Chatter

.. image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/img/failed_message_widget.png

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

.. image:: https://raw.githubusercontent.com/OCA/social/15.0/mail_tracking/static/img/failed_message_filter.png

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

* Integrate with the core `mail.notification` model. A soft way would be to write a
notification event along with the mail.tracking.event ones. Another way could be
to merge both models and build the module features on top of it. This might imply
a refactor though.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/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/social/issues/new?body=module:%20mail_tracking%0Aversion:%2015.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

Other credits
~~~~~~~~~~~~~

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Thanks to `LlubNek <https://openclipart.org/user-detail/LlubNek>`_ and `Openclipart
<https://openclipart.org>`_ for `the icon
<https://openclipart.org/detail/19342/open-envelope>`_.

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/social <https://github.com/OCA/social/tree/15.0/mail_tracking>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions mail_tracking/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from . import controllers
58 changes: 58 additions & 0 deletions mail_tracking/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2018 David Vidal - <david.vidal@tecnativa.com>
# 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",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit description is dirty, it seems a lot of fixups were squashed without writting a proper description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, I'll clean the description once I'm done implementing your suggestions, thanks!

"summary": "Email tracking system for all mails sent",
"version": "16.0.1.0.0",
"category": "Social Network",
"website": "https://github.com/OCA/social",
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["mail"],
"data": [
"data/tracking_data.xml",
"security/mail_tracking_email_security.xml",
"security/ir.model.access.csv",
"views/mail_tracking_email_view.xml",
"views/mail_tracking_event_view.xml",
"views/mail_message_view.xml",
"views/res_partner_view.xml",
],
"assets": {
"web.assets_backend": [
"mail_tracking/static/src/client_actions/failed_message_storage.esm.js",
"mail_tracking/static/src/models/chatter.esm.js",
"mail_tracking/static/src/models/discuss_sidebar_mailbox_view.esm.js",
"mail_tracking/static/src/models/discuss_view.esm.js",
"mail_tracking/static/src/models/mailbox.esm.js",
"mail_tracking/static/src/models/message_list_view_item.esm.js",
"mail_tracking/static/src/models/message_list_view.esm.js",
"mail_tracking/static/src/models/message_view.esm.js",
"mail_tracking/static/src/models/message.esm.js",
"mail_tracking/static/src/models/messaging_initializer.esm.js",
"mail_tracking/static/src/models/messaging.esm.js",
"mail_tracking/static/src/models/thread.esm.js",
"mail_tracking/static/src/components/discuss/discuss.xml",
"mail_tracking/static/src/components/message/message.xml",
"mail_tracking/static/src/components/message/message.esm.js",
"mail_tracking/static/src/components/message/message.scss",
"mail_tracking/static/src/components/message_list/message_list.esm.js",
"mail_tracking/static/src/components/failed_message/failed_message.xml",
"mail_tracking/static/src/components/failed_message/failed_message.esm.js",
"mail_tracking/static/src/components/failed_message/failed_message.scss",
"mail_tracking/static/src/components/failed_message_list/failed_message_list.xml",
"mail_tracking/static/src/components/failed_message_list/failed_message_list.esm.js", # noqa: B950
"mail_tracking/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.xml", # noqa: B950
"mail_tracking/static/src/components/discuss_sidebar_mailbox/discuss_sidebar_mailbox.esm.js", # noqa: B950
"mail_tracking/static/src/components/thread_view/thread_view.xml",
"mail_tracking/static/src/components/thread_view/thread_view.scss",
],
},
"demo": ["demo/demo.xml"],
}
4 changes: 4 additions & 0 deletions mail_tracking/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import main
from . import discuss
28 changes: 28 additions & 0 deletions mail_tracking/controllers/discuss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import http

from odoo.addons.mail.controllers.discuss import DiscussController


class MailTrackingDiscussController(DiscussController):
@http.route()
def mail_init_messaging(self, **kwargs):
"""Route used to initial values of Discuss app"""
values = super().mail_init_messaging(**kwargs)
values.update(
{"failed_counter": http.request.env["mail.message"].get_failed_count()}
)
return values

@http.route("/mail/failed/messages", methods=["POST"], type="json", auth="user")
def discuss_failed_messages(self, max_id=None, min_id=None, limit=30, **kwargs):
return (
http.request.env["mail.message"]
._message_fetch(
domain=[("is_failed_message", "=", True)],
max_id=max_id,
min_id=min_id,
limit=limit,
)
.message_format()
)
76 changes: 76 additions & 0 deletions mail_tracking/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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.db_filter([dbname]):
raise werkzeug.exceptions.BadRequest()
cr = None
if dbname == http.request.db:
cr = http.request.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:
_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_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
forcecreate="True"
id="decimal_tracking_timestamp"
model="decimal.precision"
>
<field name="name">MailTracking Timestamp</field>
<field name="digits">6</field>
</record>
</odoo>
Loading
Loading