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