@@ -15,6 +15,7 @@ import { DiscordConfig } from './providers/discord'
1515import { GenericConfig } from './providers/generic'
1616import { GithubConfig } from './providers/github'
1717import { GmailConfig } from './providers/gmail'
18+ import { MicrosoftTeamsConfig } from './providers/microsoftteams'
1819import { SlackConfig } from './providers/slack'
1920import { StripeConfig } from './providers/stripe'
2021import { TelegramConfig } from './providers/telegram'
@@ -79,6 +80,8 @@ export function WebhookModal({
7980 const [ discordAvatarUrl , setDiscordAvatarUrl ] = useState ( '' )
8081 const [ slackSigningSecret , setSlackSigningSecret ] = useState ( '' )
8182 const [ telegramBotToken , setTelegramBotToken ] = useState ( '' )
83+ // Microsoft Teams-specific state
84+ const [ microsoftTeamsHmacSecret , setMicrosoftTeamsHmacSecret ] = useState ( '' )
8285 // Airtable-specific state
8386 const [ airtableWebhookSecret , _setAirtableWebhookSecret ] = useState ( '' )
8487 const [ airtableBaseId , setAirtableBaseId ] = useState ( '' )
@@ -103,6 +106,7 @@ export function WebhookModal({
103106 airtableTableId : '' ,
104107 airtableIncludeCellValues : false ,
105108 telegramBotToken : '' ,
109+ microsoftTeamsHmacSecret : '' ,
106110 selectedLabels : [ 'INBOX' ] as string [ ] ,
107111 labelFilterBehavior : 'INCLUDE' ,
108112 markAsRead : false ,
@@ -259,6 +263,15 @@ export function WebhookModal({
259263 includeRawEmail : config . includeRawEmail ,
260264 } ) )
261265 }
266+ } else if ( webhookProvider === 'microsoftteams' ) {
267+ const hmacSecret = config . hmacSecret || ''
268+
269+ setMicrosoftTeamsHmacSecret ( hmacSecret )
270+
271+ setOriginalValues ( ( prev ) => ( {
272+ ...prev ,
273+ microsoftTeamsHmacSecret : hmacSecret ,
274+ } ) )
262275 }
263276 }
264277 }
@@ -303,7 +316,9 @@ export function WebhookModal({
303316 ! originalValues . selectedLabels . every ( ( label ) => selectedLabels . includes ( label ) ) ||
304317 labelFilterBehavior !== originalValues . labelFilterBehavior ||
305318 markAsRead !== originalValues . markAsRead ||
306- includeRawEmail !== originalValues . includeRawEmail ) )
319+ includeRawEmail !== originalValues . includeRawEmail ) ) ||
320+ ( webhookProvider === 'microsoftteams' &&
321+ microsoftTeamsHmacSecret !== originalValues . microsoftTeamsHmacSecret )
307322
308323 setHasUnsavedChanges ( hasChanges )
309324 } , [
@@ -327,6 +342,7 @@ export function WebhookModal({
327342 labelFilterBehavior ,
328343 markAsRead ,
329344 includeRawEmail ,
345+ microsoftTeamsHmacSecret ,
330346 ] )
331347
332348 // Validate required fields for current provider
@@ -354,6 +370,9 @@ export function WebhookModal({
354370 case 'gmail' :
355371 isValid = selectedLabels . length > 0
356372 break
373+ case 'microsoftteams' :
374+ isValid = microsoftTeamsHmacSecret . trim ( ) !== ''
375+ break
357376 }
358377 setIsCurrentConfigValid ( isValid )
359378 } , [
@@ -364,6 +383,7 @@ export function WebhookModal({
364383 whatsappVerificationToken ,
365384 telegramBotToken ,
366385 selectedLabels ,
386+ microsoftTeamsHmacSecret ,
367387 ] )
368388
369389 // Use the provided path or generate a UUID-based path
@@ -433,6 +453,10 @@ export function WebhookModal({
433453 return {
434454 botToken : telegramBotToken || undefined ,
435455 }
456+ case 'microsoftteams' :
457+ return {
458+ hmacSecret : microsoftTeamsHmacSecret ,
459+ }
436460 default :
437461 return { }
438462 }
@@ -482,6 +506,7 @@ export function WebhookModal({
482506 airtableTableId,
483507 airtableIncludeCellValues,
484508 telegramBotToken,
509+ microsoftTeamsHmacSecret,
485510 selectedLabels,
486511 labelFilterBehavior,
487512 markAsRead,
@@ -727,6 +752,18 @@ export function WebhookModal({
727752 webhookUrl = { webhookUrl }
728753 />
729754 )
755+ case 'microsoftteams' :
756+ return (
757+ < MicrosoftTeamsConfig
758+ hmacSecret = { microsoftTeamsHmacSecret }
759+ setHmacSecret = { setMicrosoftTeamsHmacSecret }
760+ isLoadingToken = { isLoadingToken }
761+ testResult = { testResult }
762+ copied = { copied }
763+ copyToClipboard = { copyToClipboard }
764+ testWebhook = { testWebhook }
765+ />
766+ )
730767 default :
731768 return (
732769 < GenericConfig
0 commit comments