gaur3009 commited on
Commit
3c40d6a
·
verified ·
1 Parent(s): b45ba66

Create integrations.py

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