Dashboard
Messages
Advanced Chatbot
Subscribers
Workshops
Video Resources
Tai Chi Videos
Coach Pei Corner
Johanna Corner
BFSAN Inquiries
Programs
12-Week Risk Reduction
Command Center
Participants
Consent Audit
Baseline Review
Goal Configuration
Weekly Scoring
Interventions
Coach Messages
Analytics
Daily Logs
Email Templates
30-Day Challenge
Nutritional Wellness
Tai Chi Program
Pickleball Program
8-Week Challenge
Soon
Educational Seminar
Soon
System
Cookie Consent Logs
Testimonials
Submissions
Users
System Settings
View Website
Edit Knowledge
Log In
Edit Knowledge Base Item
← Back to List
Title
Category
SubCategory
User Intent
Primary Question
Keywords (comma separated)
Content (Knowledge provided to AI)
Community Messages @if (Model.Messages.Count == 0) { You have no contact messages yet. } else { Date Name Email Area of Interest Actions @foreach (var message in Model.Messages) { var rowStyle = message.IsRead ? "" : "background-color: rgba(8, 85, 54, 0.08);"; @message.SubmittedAt.ToString("MMM dd, yyyy HH:mm") @message.FullName @message.Email @message.AreaOfInterest View Details } } @section Scripts { @Html.AntiForgeryToken() // Store messages in a map for quick JS lookup const messages = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model.Messages.ToDictionary(m => m.Id, m => m))); function viewMessage(id) { const msg = messages[id]; if (!msg) return; let detailsHtml = ` Name: ${msg.FullName} Email: ${msg.Email} Phone: ${msg.Phone ? msg.Phone : 'N/A'} Address: ${msg.Address ? msg.Address : 'N/A'} Interest: ${msg.AreaOfInterest} Message: ${msg.Message} Go to User Management to Enroll `; Swal.fire({ title: 'Message Details', html: detailsHtml, width: '600px', confirmButtonColor: '#085536', confirmButtonText: 'Close' }); // Mark as read dynamically if (!msg.IsRead) { const token = document.querySelector('input[name="__RequestVerificationToken"]').value; fetch('?handler=MarkAsRead', { method: 'POST', headers: { 'Content-Type': 'application/json', 'RequestVerificationToken': token }, body: JSON.stringify(id) }) .then(response => response.json()) .then(data => { if (data.success) { msg.IsRead = true; // Update UI const row = document.getElementById('msg-row-' + id); if (row) { row.style.backgroundColor = 'transparent'; // Fades to white due to CSS transition } const badge = document.getElementById('badge-' + id); if (badge) { badge.style.display = 'none'; } // Dynamically decrement top navigation notification bell const navBadge = document.getElementById('notification-badge'); if (navBadge) { let currentCount = parseInt(navBadge.innerText); if (!isNaN(currentCount) && currentCount > 0) { currentCount--; if (currentCount === 0) { navBadge.style.display = 'none'; } else { navBadge.innerText = currentCount; } } } } }) .catch(err => console.error("Error marking message as read", err)); } } function deleteMessage(id) { Swal.fire({ title: 'Delete Message?', text: "This action cannot be undone.", icon: 'warning', showCancelButton: true, confirmButtonColor: '#ba1a1a', cancelButtonColor: '#707972', confirmButtonText: 'Yes, delete it' }).then((result) => { if (result.isConfirmed) { const token = document.querySelector('input[name="__RequestVerificationToken"]').value; fetch('?handler=Delete', { method: 'POST', headers: { 'Content-Type': 'application/json', 'RequestVerificationToken': token }, body: JSON.stringify(id) }) .then(response => response.json()) .then(data => { if (data.success) { const row = document.getElementById('msg-row-' + id); if (row) { row.remove(); } // Check if no messages left to display empty state if (document.querySelectorAll('tbody tr').length === 0) { window.location.reload(); } else { Swal.fire('Deleted!', 'The message has been deleted.', 'success'); } } else { Swal.fire('Error', 'Could not delete message.', 'error'); } }) .catch(err => console.error("Error deleting message", err)); } }); } }
Page Title
Page URL
Related Questions (JSON Array of strings)
Recommended Actions (JSON Array of objects)
[]
Active
Save Changes
Cancel