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',
'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 '

21
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'}

5
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

Loading…
Cancel
Save