diff --git a/brevo_connector/__manifest__.py b/brevo_connector/__manifest__.py index 9c123ccbc..4a0313485 100755 --- a/brevo_connector/__manifest__.py +++ b/brevo_connector/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Brevo Connector', - 'version': '16.0.1.0.0', + 'version': '16.0.1.0.1', 'category': 'Discuss', 'summary': 'Allows to view the status of mail send by Odoo by connecting to Brevo.', 'description': 'This module provides the ability to track the Status of ' diff --git a/brevo_connector/controllers/brevo_connector.py b/brevo_connector/controllers/brevo_connector.py index facf3a799..d31becb1e 100755 --- a/brevo_connector/controllers/brevo_connector.py +++ b/brevo_connector/controllers/brevo_connector.py @@ -35,15 +35,22 @@ class BrevoRequest(http.Controller): def sent(self): """Function for getting statuses into odoo""" data = json.loads(request.httprequest.data) - _logger.info(data) - message_id = request.env['mail.message'].sudo().search( - [('message_id', 'ilike', data['message-id'])], limit=1) + # Define subtypes to exclude (Notes) + excluded_subtypes = [ + request.env.ref('mail.mt_note').id, + ] + message_id = request.env['mail.message'].sudo().search([ + ('message_id', '=', data['message-id']), + ('message_type', 'in', ['email', 'comment', 'user_notification', 'auto_comment']), + ('subtype_id', 'not in', excluded_subtypes)], limit=1) if message_id: + # Update the mail.message with status and receiver message_id.write({ 'status': data.get('event'), 'receiver': data.get('email'), }) - if data.get('event') == 'click': - data.get('link') - else: - return 'ok', 200 + # Handle click events (log the clicked link) + if data.get('event') == 'click' and data.get('link'): + _logger.info("Click event recorded for message %s: Link %s", + message_id.id, data.get('link')) + return {'status': 'ok'} diff --git a/brevo_connector/doc/RELEASE_NOTES.md b/brevo_connector/doc/RELEASE_NOTES.md index 65e9088a5..d6a064b8b 100755 --- a/brevo_connector/doc/RELEASE_NOTES.md +++ b/brevo_connector/doc/RELEASE_NOTES.md @@ -3,3 +3,8 @@ #### Version 16.0.1.0.0 #### ADD - Initial commit for Brevo Connector + +#### 02.05.2025 +#### Version 16.0.1.0.1 +#### UPDATE +- Updated controller for getting mail status