Secure Enterprise Email & Communication Management
Email Inbox
| From | Subject | Date |
|---|
Calendar
Upcoming Events
Add New Event
Contacts
Contact List
Add New Contact
${event.date}
`; eventList.appendChild(div); }); // Render contact list const contactList = document.getElementById('contactList'); contactList.innerHTML = ''; contacts.forEach(contact => { const div = document.createElement('div'); div.className = 'p-2 border rounded'; div.innerHTML = `${contact.name}
${contact.email}
`; contactList.appendChild(div); }); }; /** * Generates and downloads a professional PDF summary. */ const downloadPDF = () => { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(22); doc.text('Communication Summary', 14, 22); // Emails doc.setFontSize(16); doc.text('Recent Emails', 14, 40); doc.autoTable({ startY: 45, head: [['From', 'Subject', 'Date']], body: emails.map(e => [e.from, e.subject, e.date]), theme: 'grid', headStyles: { fillColor: [59, 130, 246] } }); // Events doc.text('Upcoming Events', 14, doc.autoTable.previous.finalY + 15); doc.autoTable({ startY: doc.autoTable.previous.finalY + 20, head: [['Event', 'Date']], body: events.map(e => [e.title, e.date]), theme: 'grid', headStyles: { fillColor: [59, 130, 246] } }); // Contacts doc.text('Contacts', 14, doc.autoTable.previous.finalY + 15); doc.autoTable({ startY: doc.autoTable.previous.finalY + 20, head: [['Name', 'Email']], body: contacts.map(c => [c.name, c.email]), theme: 'grid', headStyles: { fillColor: [59, 130, 246] } }); doc.save('Communication_Summary.pdf'); }; // --- Event Listeners --- prevBtn.addEventListener('click', () => changeTab(currentTab - 1)); nextBtn.addEventListener('click', () => changeTab(currentTab + 1)); pdfDownloadBtn.addEventListener('click', downloadPDF); document.getElementById('eventForm').addEventListener('submit', (e) => { e.preventDefault(); events.push({ title: document.getElementById('eventTitle').value, date: document.getElementById('eventDate').value }); e.target.reset(); render(); }); document.getElementById('contactForm').addEventListener('submit', (e) => { e.preventDefault(); contacts.push({ name: document.getElementById('contactName').value, email: document.getElementById('contactEmail').value }); e.target.reset(); render(); }); // --- Initial Setup --- const initializeTool = () => { render(); updateNavButtons(); }; initializeTool(); });