From ac8650d48611037c23a6cf8867a51683d988a426 Mon Sep 17 00:00:00 2001 From: Neel Bhanushali Date: Mon, 6 May 2024 20:26:07 +0530 Subject: [PATCH] added automated_messages from communications to activites --- crm/api/activities.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/crm/api/activities.py b/crm/api/activities.py index 3cd9e9f3..c9f88262 100644 --- a/crm/api/activities.py +++ b/crm/api/activities.py @@ -129,6 +129,25 @@ def get_deal_activities(name): } activities.append(activity) + for communication in docinfo.automated_messages: + activity = { + "activity_type": "communication", + "creation": communication.creation, + "data": { + "subject": communication.subject, + "content": communication.content, + "sender_full_name": communication.sender_full_name, + "sender": communication.sender, + "recipients": communication.recipients, + "cc": communication.cc, + "bcc": communication.bcc, + "attachments": get_attachments('Communication', communication.name), + "read_by_recipient": communication.read_by_recipient, + }, + "is_lead": False, + } + activities.append(activity) + calls = calls + get_linked_calls(name) notes = notes + get_linked_notes(name) tasks = tasks + get_linked_tasks(name) @@ -241,6 +260,25 @@ def get_lead_activities(name): } activities.append(activity) + for communication in docinfo.automated_messages: + activity = { + "activity_type": "communication", + "creation": communication.creation, + "data": { + "subject": communication.subject, + "content": communication.content, + "sender_full_name": communication.sender_full_name, + "sender": communication.sender, + "recipients": communication.recipients, + "cc": communication.cc, + "bcc": communication.bcc, + "attachments": get_attachments('Communication', communication.name), + "read_by_recipient": communication.read_by_recipient, + }, + "is_lead": True, + } + activities.append(activity) + calls = get_linked_calls(name) notes = get_linked_notes(name) tasks = get_linked_tasks(name)