andere app id

This commit is contained in:
JM 2026-05-05 16:58:59 +02:00
parent f9cff1f137
commit c3fec7dde7
1 changed files with 32 additions and 33 deletions

View File

@ -33,52 +33,50 @@ class NotificationPayloadFactory
// $discussionUrl = $this->resolveSubjectUrl($blueprint) ?? 'https://forum.sbp.de';
// $previewSnippet = $this->buildPreviewText($blueprint);
// $discussionTitle = 'Backup-Strategie für Forum';
// $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.';
// $reasonText = 'Neue Antwort in beobachteter Diskussion';
// // Freie Actor+Reason-Zeile für systemDefault
// $reasonText = match ($blueprint::getType()) {
// 'newPost' => 'There was a new answer in one of your folloed posts',
// 'postMentioned' => 'Your post has been mentioned',
// 'userMentioned' => 'You have been mentioned',
// 'postLiked' => 'Your post has been liked',
// default => 'New sbp forum update',
// };
$discussionTitle = 'Backup-Strategie für Forum';
$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.';
$reasonText = 'Neue Antwort in beobachteter Diskussion';
// ✅ Teams AppCatalog ID (aus Get-TeamsApp)
$teamsCatalogAppId = '61e3fb91-4b17-428f-856b-51a345e10f06';
// Freie Actor+Reason-Zeile für systemDefault
$reasonText = match ($blueprint::getType()) {
'newPost' => 'There was a new answer in one of your folloed posts',
'postMentioned' => 'Your post has been mentioned',
'userMentioned' => 'You have been mentioned',
'postLiked' => 'Your post has been liked',
default => 'New sbp forum update',
};
// Teams-App-/Tab-Ziel aus deinem aktuellen Manifest
$teamsManifestAppId = 'd92b1be6-ea92-46b1-bcb0-c08ffdd1a61a';
$teamsEntityId = '8ffe419f-ca44-4627-a4b2-f223da2d07aa';
$discussionTitle = 'Backup-Strategie für Forum';
$discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
// ✅ kompakte Unterseiten-ID (KEINE URL!)
$subEntityId = 'discussion:34:2';
// ✅ Kontext für entityUrl
$contextJson = json_encode([
'subEntityId' => $subEntityId,
'subEntityId' => $subEntityId
], JSON_UNESCAPED_SLASHES);
$teamsDeepLink = sprintf(
'https://teams.microsoft.com/l/entity/%s/%s?tenantId=%s&webUrl=%s&label=%s&context=%s',
rawurlencode('d92b1be6-ea92-46b1-bcb0-c08ffdd1a61a'),
rawurlencode('8ffe419f-ca44-4627-a4b2-f223da2d07aa'),
rawurlencode('e2052793-a0f4-47d8-a3a3-52c926e79df5'),
rawurlencode($discussionUrl),
rawurlencode($discussionTitle),
// ✅ entityUrl (KEIN webUrl, KEIN Deep Link)
$entityUrl = sprintf(
'https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/%s?context=%s',
rawurlencode($teamsCatalogAppId),
rawurlencode($contextJson)
);
$payload = [
'topic' => [
'source' => 'text',
'value' => $discussionTitle,
'webUrl' => $teamsDeepLink,
'source' => 'entityUrl',
'value' => $entityUrl,
],
'activityType' => $activityType !== '' ? $activityType : 'systemDefault',
'activityType' => 'systemDefault',
'previewText' => [
'content' => mb_substr($previewSnippet, 0, 150),
],
@ -90,6 +88,7 @@ class NotificationPayloadFactory
],
];
if ($iconId !== '') {
$payload['iconId'] = $iconId;
}