test
This commit is contained in:
parent
8a61d36316
commit
649ada1244
|
|
@ -28,24 +28,50 @@ class NotificationPayloadFactory
|
||||||
$teamsAppId = trim((string) $this->settings->get('sbp-jm-msteams-webhook.teams_app_id', ''));
|
$teamsAppId = trim((string) $this->settings->get('sbp-jm-msteams-webhook.teams_app_id', ''));
|
||||||
$iconId = trim((string) $this->settings->get('sbp-jm-msteams-webhook.icon_id', ''));
|
$iconId = trim((string) $this->settings->get('sbp-jm-msteams-webhook.icon_id', ''));
|
||||||
|
|
||||||
$payload = [
|
$discussionTitle = 'Backup-Strategie für Forum';
|
||||||
'topic' => [
|
$discussionUrl = 'https://forum.sbp.de/d/34-which-file-extensions-are-allowed-for-uploads/2';
|
||||||
'source' => 'text',
|
$previewSnippet = 'Bitte prüft, ob wir tägliche Snapshots brauchen.';
|
||||||
'value' => 'Flarum Test',
|
$reasonText = 'Neue Antwort in beobachteter Diskussion';
|
||||||
'webUrl' => 'https://teams.microsoft.com/l/entity/d92b1be6-ea92-46b1-bcb0-c08ffdd1a61a/8ffe419f-ca44>
|
|
||||||
],
|
|
||||||
'activityType' => 'systemDefault',
|
|
||||||
'previewText' => [
|
|
||||||
'content' => 'Test aus Flarum',
|
|
||||||
],
|
|
||||||
'templateParameters' => [
|
|
||||||
[
|
|
||||||
'name' => 'systemDefaultText',
|
|
||||||
'value' => 'Test aus Flarum',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
//$discussionTitle = $discussionTitle ?? 'Neue Diskussion';
|
||||||
|
//$discussionUrl = $discussionUrl ?? 'https://forum.sbp.de';
|
||||||
|
//$previewSnippet = $previewSnippet ?? 'Neue Aktivität in Flarum';
|
||||||
|
//$reasonText = $reasonText ?? 'Neue Antwort in beobachteter Diskussion';
|
||||||
|
|
||||||
|
// Teams-App-/Tab-Ziel aus deinem aktuellen Manifest:
|
||||||
|
$teamsManifestAppId = 'd92b1be6-ea92-46b1-bcb0-c08ffdd1a61a';
|
||||||
|
$teamsEntityId = '8ffe419f-ca44-4627-a4b2-f223da2d07aa';
|
||||||
|
|
||||||
|
// Deep Link auf den Personal Tab in Teams.
|
||||||
|
// webUrl ist der Fallback und zeigt direkt auf die Flarum-Diskussion.
|
||||||
|
$teamsDeepLink = sprintf(
|
||||||
|
'https://teams.microsoft.com/l/entity/%s/%s?webUrl=%s&label=%s',
|
||||||
|
rawurlencode($teamsManifestAppId),
|
||||||
|
rawurlencode($teamsEntityId),
|
||||||
|
rawurlencode($discussionUrl),
|
||||||
|
rawurlencode($discussionTitle)
|
||||||
|
);
|
||||||
|
|
||||||
|
$payload = [
|
||||||
|
'topic' => [
|
||||||
|
'source' => 'text',
|
||||||
|
'value' => $discussionTitle,
|
||||||
|
'webUrl' => $teamsDeepLink,
|
||||||
|
],
|
||||||
|
'activityType' => 'systemDefault',
|
||||||
|
'previewText' => [
|
||||||
|
'content' => $previewSnippet,
|
||||||
|
],
|
||||||
|
'templateParameters' => [
|
||||||
|
[
|
||||||
|
'name' => 'systemDefaultText',
|
||||||
|
'value' => $reasonText,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
// if ($teamsAppId !== '') {
|
// if ($teamsAppId !== '') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue