The SOBIE Conference Communication System provides comprehensive messaging, announcements, and notification capabilities with special support for schedule changes that preserve original information using strikethrough formatting.
GET /api/communications/messages
Query Parameters:
type
- Message type (direct, announcement, schedule_change)status
- Read status (read, unread)conferenceId
- Filter by conferencepage
- Page number (default: 1)limit
- Results per page (default: 20, max: 100)search
- Search in subject/content/senderGET /api/communications/messages/:messageId
Response includes:
POST /api/communications/messages
Body:
{
"subject": "Meeting Request",
"content": "Let's discuss the research proposal.",
"recipientIds": ["user1_id", "user2_id"],
"messageType": "direct",
"priority": "normal",
"conferenceId": "conference_id",
"attachments": [
{
"filename": "proposal.pdf",
"fileType": "application/pdf",
"fileSize": 1024000,
"url": "https://storage.example.com/files/proposal.pdf"
}
],
"scheduledSendTime": "2024-03-15T10:00:00Z"
}
POST /api/communications/messages/:messageId/reply
Body:
{
"content": "Thanks for the information!",
"replyToAll": false
}
POST /api/communications/announcements
Required Roles: Admin, Conference Chairperson, Editor
Body:
{
"subject": "Important Conference Update",
"content": "Please review the updated conference schedule.",
"conferenceId": "conference_id",
"priority": "high",
"targetAudience": "all",
"scheduledSendTime": "2024-03-15T09:00:00Z"
}
Target Audience Options:
all
- All active usersstudents
- Student user type onlyacademics
- Academic user type onlyspecific_roles
- Specified roles (requires specificRoles
array)POST /api/communications/schedule-changes
Required Roles: Admin, Editor
Body:
{
"sessionId": "session_id",
"changeType": "time",
"originalData": {
"scheduledTime": "2024-03-15T10:00:00Z",
"location": "Room A101"
},
"newData": {
"scheduledTime": "2024-03-15T14:00:00Z",
"location": "Room B205"
},
"reason": "Venue conflict resolution",
"customMessage": "We apologize for any inconvenience caused by this change."
}
Change Types:
time
- Time modificationlocation
- Venue changecancellation
- Session cancelledpostponement
- Session delayedother
- Custom change typeGET /api/communications/notifications
Query Parameters:
status
- Read status (read, unread)type
- Notification type (message, announcement, schedule_change, system, community)conferenceId
- Filter by conferencepage
- Page numberlimit
- Results per pageincludeRead
- Include read notifications (default: true)PUT /api/communications/notifications/:notificationId/read
PUT /api/communications/notifications/mark-read
Body:
{
"notificationIds": ["notif1_id", "notif2_id"]
}
GET /api/communications/stats
Response:
{
"success": true,
"data": {
"messages": {
"total": 45,
"unread": 3,
"byType": {
"direct": 30,
"announcement": 10,
"schedule_change": 5
}
},
"notifications": {
"total": 67,
"unread": 8,
"byType": {
"message": 40,
"announcement": 15,
"schedule_change": 8,
"system": 4
}
}
}
}
GET /api/communications/messages/search?q=research&type=direct
The system automatically generates rich HTML for schedule changes with strikethrough formatting for original data:
<div class="schedule-change-notification">
<div class="change-header">
<h3>⚠️ Schedule Change: TIME CHANGE</h3>
<p><strong>Reason:</strong> Venue conflict resolution</p>
</div>
<div class="change-details">
<div class="change-item">
<strong>Time:</strong>
<span class="original-value">March 15, 2024 10:00 AM</span>
<span class="arrow">→</span>
<span class="new-value">March 15, 2024 2:00 PM</span>
</div>
<div class="change-item">
<strong>Location:</strong>
<span class="original-value">Room A101</span>
<span class="arrow">→</span>
<span class="new-value">Room B205</span>
</div>
</div>
</div>
.schedule-change-notification .original-value {
text-decoration: line-through;
color: #999;
background-color: #ffe6e6;
padding: 2px 4px;
border-radius: 3px;
}
.schedule-change-notification .new-value {
color: #d73527;
background-color: #e6f3ff;
padding: 2px 4px;
border-radius: 3px;
font-weight: bold;
}
{
subject: String,
content: String,
messageType: ['direct', 'announcement', 'schedule_change'],
priority: ['low', 'normal', 'high', 'urgent'],
senderId: ObjectId,
recipients: [{
userId: ObjectId,
readStatus: ['unread', 'read'],
readTimestamp: Date,
deliveryStatus: ['pending', 'delivered', 'failed']
}],
scheduleChange: {
changeType: String,
originalData: Object,
newData: Object
},
attachments: [{
filename: String,
fileType: String,
fileSize: Number,
url: String
}],
threadId: ObjectId,
parentMessageId: ObjectId,
isReply: Boolean,
deliveryStatus: ['draft', 'sending', 'sent', 'failed'],
scheduledSendTime: Date,
actualSendTime: Date
}
{
title: String,
message: String,
type: ['message', 'announcement', 'schedule_change', 'system', 'community'],
priority: ['low', 'normal', 'high', 'urgent'],
userId: ObjectId,
status: ['unread', 'read'],
channels: [{
type: ['in_app', 'email', 'sms', 'push'],
status: ['pending', 'sent', 'delivered', 'failed'],
sentAt: Date,
deliveredAt: Date
}],
actionRequired: Boolean,
actionType: String,
actionUrl: String,
expiresAt: Date
}
const messageData = {
subject: "Research Collaboration",
content: "I'd like to discuss a potential collaboration.",
recipientIds: ["user123", "user456"],
attachments: [{
filename: "research_proposal.pdf",
fileType: "application/pdf",
fileSize: 1500000,
url: "https://storage.example.com/files/proposal.pdf"
}]
};
const response = await fetch('/api/communications/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify(messageData)
});
const announcementData = {
subject: "Conference Dinner Details",
content: "Join us for the conference dinner at the Grand Hotel.",
conferenceId: "conf123",
priority: "normal",
targetAudience: "all"
};
const response = await fetch('/api/communications/announcements', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify(announcementData)
});
const scheduleChangeData = {
sessionId: "session123",
changeType: "location",
originalData: { location: "Room A" },
newData: { location: "Online Meeting" },
reason: "Technical difficulties with AV equipment",
customMessage: "Please check your email for the meeting link."
};
const response = await fetch('/api/communications/schedule-changes', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify(scheduleChangeData)
});
Run the communication system tests:
node src/tests/communicationTests.js
This will test: