Уведомления: лента в приложении и письма по каналам
Notify рассылает по каналам database и mail, адресовать можно по праву. Роутер теперь поднимается и вне запроса, появился Router::absolute для писем.
This commit is contained in:
1 parent
7b6ac42f1e
commit
2f162a846f
24 files changed
+1234
-17
No files matched your search
@@ -4,8 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Rsgrinko\Proton\Webhooks;
|
||||
|
||||
use Rsgrinko\Proton\Access\Permission;
|
||||
use Rsgrinko\Proton\Models\Webhook;
|
||||
use Rsgrinko\Proton\Models\WebhookDelivery;
|
||||
use Rsgrinko\Proton\Notifications\Notify;
|
||||
use Rsgrinko\Proton\Notifications\WebhookDisabledNotification;
|
||||
use Rsgrinko\Proton\Queue\Job;
|
||||
use Rsgrinko\Proton\Support\Config;
|
||||
use Rsgrinko\Proton\Support\HttpClient;
|
||||
@@ -145,6 +148,15 @@ final class DeliverWebhookJob extends Job
|
||||
'error' => $error,
|
||||
'disabled' => $disabled,
|
||||
]);
|
||||
|
||||
// Отключённая подписка — это тихо потерянные события: пусть те, кто
|
||||
// отвечает за вебхуки, узнают об этом сразу
|
||||
if ($disabled) {
|
||||
Notify::toPermission(
|
||||
Permission::WEBHOOKS_MANAGE,
|
||||
new WebhookDisabledNotification($webhook, $error)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function client(): HttpClient
|
||||
|
||||
Reference in new issue
Block a user