Allow multiple Pushover users
This commit is contained in:
parent
bb7cf80704
commit
b8374a27d9
|
@ -17,13 +17,17 @@ final class ApplicationAlerters {
|
|||
list($user, $tilde, $message) = $params;
|
||||
|
||||
$application = new Pushover\Application($_ENV[IX_ENVBASE . '_PUSHOVER_API_TOKEN']);
|
||||
$recipient = new Pushover\Recipient($_ENV[IX_ENVBASE . '_PUSHOVER_USER_KEY']);
|
||||
$pushovermessage = new PushoverMessage(
|
||||
"from {$user}@{$tilde}\n> {$message}",
|
||||
'new neotel application',
|
||||
);
|
||||
|
||||
$pushoverusers = explode(',', $_ENV[IX_ENVBASE . '_PUSHOVER_USER_KEYS']);
|
||||
foreach ($pushoverusers as $userkey) {
|
||||
$recipient = new Pushover\Recipient($userkey);
|
||||
$notification = new PushoverNotification($application, $recipient, $pushovermessage);
|
||||
$response = $notification->push();
|
||||
}
|
||||
|
||||
return [$user, $tilde, $message];
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class Configuration {
|
|||
|
||||
// Pushover application and user keys
|
||||
$dotenv->required(IX_ENVBASE . '_PUSHOVER_API_TOKEN')->notEmpty();
|
||||
$dotenv->required(IX_ENVBASE . '_PUSHOVER_USER_KEY')->notEmpty();
|
||||
$dotenv->required(IX_ENVBASE . '_PUSHOVER_USER_KEYS')->notEmpty();
|
||||
|
||||
// Discord webhook URL
|
||||
$dotenv->required(IX_ENVBASE . '_DISCORD_WEBHOOK_URL')->notEmpty();
|
||||
|
|
Loading…
Reference in New Issue