MCPcopy Create free account
hub / github.com/simstudioai/sim / markOutlookEmailAsRead

Function markOutlookEmailAsRead

apps/sim/lib/webhooks/polling/outlook.ts:546–570  ·  view source on GitHub ↗
(accessToken: string, messageId: string, logger: Logger)

Source from the content-addressed store, hash-verified

544}
545
546async function markOutlookEmailAsRead(accessToken: string, messageId: string, logger: Logger) {
547 try {
548 const response = await fetchWithRetry(
549 `https://graph.microsoft.com/v1.0/me/messages/${messageId}`,
550 {
551 method: 'PATCH',
552 headers: {
553 Authorization: `Bearer ${accessToken}`,
554 'Content-Type': 'application/json',
555 },
556 body: JSON.stringify({ isRead: true }),
557 }
558 )
559
560 if (!response.ok) {
561 logger.error(
562 `Failed to mark email ${messageId} as read:`,
563 response.status,
564 await response.text()
565 )
566 }
567 } catch (error) {
568 logger.error(`Error marking email ${messageId} as read:`, error)
569 }
570}

Callers 1

processOutlookEmailsFunction · 0.85

Calls 3

fetchWithRetryFunction · 0.90
errorMethod · 0.80
textMethod · 0.80

Tested by

no test coverage detected