Browse Source

MAY 12: [FIX] Bug Fixed 'brevo_connector'

16.0
Cybrosys Technologies 2 weeks ago
parent
commit
339a7f5509
  1. 2
      brevo_connector/__manifest__.py
  2. 21
      brevo_connector/controllers/brevo_connector.py
  3. 5
      brevo_connector/doc/RELEASE_NOTES.md

2
brevo_connector/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': 'Brevo Connector', 'name': 'Brevo Connector',
'version': '16.0.1.0.0', 'version': '16.0.1.0.1',
'category': 'Discuss', 'category': 'Discuss',
'summary': 'Allows to view the status of mail send by Odoo by connecting to Brevo.', '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 ' 'description': 'This module provides the ability to track the Status of '

21
brevo_connector/controllers/brevo_connector.py

@ -35,15 +35,22 @@ class BrevoRequest(http.Controller):
def sent(self): def sent(self):
"""Function for getting statuses into odoo""" """Function for getting statuses into odoo"""
data = json.loads(request.httprequest.data) data = json.loads(request.httprequest.data)
_logger.info(data) # Define subtypes to exclude (Notes)
message_id = request.env['mail.message'].sudo().search( excluded_subtypes = [
[('message_id', 'ilike', data['message-id'])], limit=1) 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: if message_id:
# Update the mail.message with status and receiver
message_id.write({ message_id.write({
'status': data.get('event'), 'status': data.get('event'),
'receiver': data.get('email'), 'receiver': data.get('email'),
}) })
if data.get('event') == 'click': # Handle click events (log the clicked link)
data.get('link') if data.get('event') == 'click' and data.get('link'):
else: _logger.info("Click event recorded for message %s: Link %s",
return 'ok', 200 message_id.id, data.get('link'))
return {'status': 'ok'}

5
brevo_connector/doc/RELEASE_NOTES.md

@ -3,3 +3,8 @@
#### Version 16.0.1.0.0 #### Version 16.0.1.0.0
#### ADD #### ADD
- Initial commit for Brevo Connector - Initial commit for Brevo Connector
#### 02.05.2025
#### Version 16.0.1.0.1
#### UPDATE
- Updated controller for getting mail status

Loading…
Cancel
Save