Update integrations.py
Browse files- integrations.py +21 -36
integrations.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import smtplib
|
2 |
from email.mime.multipart import MIMEMultipart
|
3 |
from email.mime.text import MIMEText
|
@@ -5,35 +6,19 @@ import config
|
|
5 |
|
6 |
class Notifier:
|
7 |
def send_comprehensive_report(self, summary, action_items, decisions, transcript, recipients):
|
8 |
-
# Create
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
<body>
|
22 |
-
<h2>Meeting Summary</h2>
|
23 |
-
<p>{summary}</p>
|
24 |
-
|
25 |
-
<h2>Action Items</h2>
|
26 |
-
{action_items_html}
|
27 |
-
|
28 |
-
<h2>Key Decisions</h2>
|
29 |
-
<p>{', '.join(decisions)}</p>
|
30 |
-
|
31 |
-
<h2>Full Transcript</h2>
|
32 |
-
<pre>{transcript}</pre>
|
33 |
-
|
34 |
-
<p>Generated by MeetingMate AI</p>
|
35 |
-
</body>
|
36 |
-
</html>
|
37 |
"""
|
38 |
|
39 |
# Send to all requested channels
|
@@ -42,7 +27,7 @@ class Notifier:
|
|
42 |
self._send_email(
|
43 |
recipient["address"],
|
44 |
"Meeting Summary & Action Items",
|
45 |
-
|
46 |
)
|
47 |
|
48 |
def send_urgent_alert(self, action_items):
|
@@ -50,13 +35,13 @@ class Notifier:
|
|
50 |
if recipient["type"] == "email":
|
51 |
self._send_email_alert(recipient["address"], action_items)
|
52 |
|
53 |
-
def _send_email(self, to_address, subject,
|
54 |
msg = MIMEMultipart()
|
55 |
msg['From'] = config.EMAIL_SENDER
|
56 |
msg['To'] = to_address
|
57 |
msg['Subject'] = subject
|
58 |
|
59 |
-
msg.attach(MIMEText(
|
60 |
|
61 |
with smtplib.SMTP(config.SMTP_SERVER, config.SMTP_PORT) as server:
|
62 |
server.starttls()
|
@@ -66,16 +51,16 @@ class Notifier:
|
|
66 |
def _send_email_alert(self, to_address, action_items):
|
67 |
subject = "URGENT: Action Item Detected in Meeting"
|
68 |
items_text = "\n".join(
|
69 |
-
f"• {item['task']}
|
70 |
for item in action_items
|
71 |
)
|
72 |
|
73 |
body = f"""
|
74 |
-
|
75 |
|
76 |
-
|
77 |
|
78 |
-
|
79 |
"""
|
80 |
|
81 |
msg = MIMEMultipart()
|
|
|
1 |
+
# integrations.py (Notification System)
|
2 |
import smtplib
|
3 |
from email.mime.multipart import MIMEMultipart
|
4 |
from email.mime.text import MIMEText
|
|
|
6 |
|
7 |
class Notifier:
|
8 |
def send_comprehensive_report(self, summary, action_items, decisions, transcript, recipients):
|
9 |
+
# Create plain text content
|
10 |
+
text_content = f"""
|
11 |
+
Meeting Summary:
|
12 |
+
{summary}
|
13 |
+
|
14 |
+
Action Items:
|
15 |
+
{'\n'.join(f"- {item['task']} (Owner: {item['owner']}, Deadline: {item['deadline']})" for item in action_items)}
|
16 |
+
|
17 |
+
Key Decisions:
|
18 |
+
{'\n'.join(f"- {decision}" for decision in decisions)}
|
19 |
+
|
20 |
+
Full Transcript:
|
21 |
+
{transcript}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
"""
|
23 |
|
24 |
# Send to all requested channels
|
|
|
27 |
self._send_email(
|
28 |
recipient["address"],
|
29 |
"Meeting Summary & Action Items",
|
30 |
+
text_content
|
31 |
)
|
32 |
|
33 |
def send_urgent_alert(self, action_items):
|
|
|
35 |
if recipient["type"] == "email":
|
36 |
self._send_email_alert(recipient["address"], action_items)
|
37 |
|
38 |
+
def _send_email(self, to_address, subject, text_content):
|
39 |
msg = MIMEMultipart()
|
40 |
msg['From'] = config.EMAIL_SENDER
|
41 |
msg['To'] = to_address
|
42 |
msg['Subject'] = subject
|
43 |
|
44 |
+
msg.attach(MIMEText(text_content, 'plain'))
|
45 |
|
46 |
with smtplib.SMTP(config.SMTP_SERVER, config.SMTP_PORT) as server:
|
47 |
server.starttls()
|
|
|
51 |
def _send_email_alert(self, to_address, action_items):
|
52 |
subject = "URGENT: Action Item Detected in Meeting"
|
53 |
items_text = "\n".join(
|
54 |
+
f"• {item['task']}"
|
55 |
for item in action_items
|
56 |
)
|
57 |
|
58 |
body = f"""
|
59 |
+
Urgent action items were detected during the meeting:
|
60 |
|
61 |
+
{items_text}
|
62 |
|
63 |
+
Please address these immediately.
|
64 |
"""
|
65 |
|
66 |
msg = MIMEMultipart()
|