mal wieder ganz anders

This commit is contained in:
JM 2026-05-05 17:05:59 +02:00
parent c3fec7dde7
commit 3480c9c1cb
1 changed files with 7 additions and 25 deletions

View File

@ -48,33 +48,16 @@ class NotificationPayloadFactory
// 'postLiked' => 'Your post has been liked', // 'postLiked' => 'Your post has been liked',
// default => 'New sbp forum update', // default => 'New sbp forum update',
// }; // };
$discussionTitle = 'Backup-Strategie für Forum'; $discussionTitle = 'Backup-Strategie für Forum';
$discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2'; $discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
$previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.'; $previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.';
$reasonText = 'Neue Antwort in beobachteter Diskussion'; $reasonText = 'Neue Antwort in beobachteter Diskussion';
// ✅ Teams AppCatalog ID (aus Get-TeamsApp)
$teamsCatalogAppId = '61e3fb91-4b17-428f-856b-51a345e10f06';
// ✅ kompakte Unterseiten-ID (KEINE URL!)
$subEntityId = 'discussion:34:2';
// ✅ Kontext für entityUrl
$contextJson = json_encode([
'subEntityId' => $subEntityId
], JSON_UNESCAPED_SLASHES);
// ✅ entityUrl (KEIN webUrl, KEIN Deep Link)
$entityUrl = sprintf(
'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/%s?context=%s',
rawurlencode($teamsCatalogAppId),
rawurlencode($contextJson)
);
$payload = [ $payload = [
'topic' => [ 'topic' => [
'source' => 'entityUrl', 'source' => 'text',
'value' => $entityUrl, 'value' => $discussionTitle,
'webUrl' => $discussionUrl, // ✅ DIREKT ins Forum
], ],
'activityType' => 'systemDefault', 'activityType' => 'systemDefault',
'previewText' => [ 'previewText' => [
@ -88,7 +71,6 @@ class NotificationPayloadFactory
], ],
]; ];
if ($iconId !== '') { if ($iconId !== '') {
$payload['iconId'] = $iconId; $payload['iconId'] = $iconId;
} }