feat: improve Apprise notification subject/title handling and fallbacks

- lib/Controller/WebhookController.php: Extract subject/title from wrapper level and add fallback to default sender name
- lib/Service/TalkService.php: Update display name logic to check subject, and use title/subject as message body when empty
This commit is contained in:
kyle
2026-06-12 17:53:30 -07:00
parent 28d0187760
commit 98e044ede7
2 changed files with 27 additions and 2 deletions
+13
View File
@@ -233,7 +233,20 @@ class WebhookController extends Controller {
// Apprise API wraps notifications in a "notifications" array
if (isset($data['notifications']) && is_array($data['notifications']) && !empty($data['notifications'])) {
$wrapper = $data;
$data = $data['notifications'][0];
// Some Apprise versions put subject/title at the wrapper level
if (empty($data['subject']) && !empty($wrapper['subject'])) {
$data['subject'] = $wrapper['subject'];
}
if (empty($data['title']) && !empty($wrapper['title'])) {
$data['title'] = $wrapper['title'];
}
}
// Fallback: if no subject/title anywhere, use config default
if (empty($data['subject']) && empty($data['title'])) {
$data['subject'] = $this->talkService->getSenderNameDefault();
}
// Map apprise format to our internal payload format