Skip to content

Commit 89542cd

Browse files
feat: allow callback url to be supplied for emergency notification callback requests
1 parent 31ff8c1 commit 89542cd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/PushoverMessage.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ class PushoverMessage
8585
* @var string|null
8686
*/
8787
public string|null $image = null;
88+
/**
89+
* The (optional) publicly-accessible url that Pushover will use to notify your system when a user
90+
* acknowledges an Emergency notification
91+
* @var string|null
92+
*/
93+
public string|null $callback = null;
8894

8995
/**
9096
* Message formats.
@@ -324,6 +330,20 @@ public function emergencyPriority(int $retryTimeout, int $expireAfter): static
324330
return $this->priority(self::EMERGENCY_PRIORITY, $retryTimeout, $expireAfter);
325331
}
326332

333+
/**
334+
* Set the callback url used by pushover to let your system
335+
* know when a emergency notification has been acknowledged
336+
*
337+
* @param string $url
338+
* @return $this
339+
*/
340+
public function callback(string $url): static
341+
{
342+
$this->callback = $url;
343+
344+
return $this;
345+
}
346+
327347
/**
328348
* Array representation of Pushover Message.
329349
*
@@ -344,6 +364,7 @@ public function toArray(): array
344364
'expire' => $this->expire,
345365
'html' => $this->format === static::FORMAT_HTML,
346366
'monospace' => $this->format === static::FORMAT_MONOSPACE,
367+
'callback' => $this->callback
347368
];
348369
}
349370

0 commit comments

Comments
 (0)