markRead
codebolt.mail.markRead(params: IMarkReadParams): Promise<IMarkReadResponse>
Marks a message or thread as read.
Parameters
params(IMarkReadParams): Parameters including messageId or threadId to mark as read.
Returns
Promise<IMarkReadResponse>: A promise that resolves when the message/thread is marked read.
Response Structure
interface IMarkReadResponse {
success: boolean;
error?: string;
}
Examples
Example 1: Mark a Message as Read
import codebolt from '@codebolt/codeboltjs';
await codebolt.waitForReady();
const result = await codebolt.mail.markRead({
messageId: 'msg-123'
});
if (result.success) {
console.log('Message marked as read');
}
Common Use Cases
- Read Receipts: Mark messages as read
- Inbox Management: Clear unread indicators
- Tracking: Track message read status
Notes
- Updates read status for the message
- Can mark individual messages or entire threads
- Idempotent operation (safe to call multiple times)