mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add Webhook content message
This commit is contained in:
@@ -24,7 +24,10 @@ class DomainOrderErrorNotification extends Notification implements ChatNotificat
|
||||
|
||||
public function asChatMessage(?RecipientInterface $recipient = null, ?string $transport = null): ?ChatMessage
|
||||
{
|
||||
$this->subject('Error: Domain Order');
|
||||
$ldhName = $this->domain->getLdhName();
|
||||
$this->subject("Error: Domain Order $ldhName")
|
||||
->content("Domain name $ldhName tried to be purchased. The attempt failed.")
|
||||
->importance(Notification::IMPORTANCE_HIGH);
|
||||
|
||||
return ChatMessage::fromNotification($this);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ class DomainOrderNotification extends Notification implements ChatNotificationIn
|
||||
|
||||
public function asChatMessage(?RecipientInterface $recipient = null, ?string $transport = null): ?ChatMessage
|
||||
{
|
||||
$this->subject('Domain Ordered');
|
||||
$ldhName = $this->domain->getLdhName();
|
||||
$this
|
||||
->subject("Success: Domain Ordered $ldhName!")
|
||||
->content("Domain name $ldhName has just been purchased. The API provider did not return an error.")
|
||||
->importance(Notification::IMPORTANCE_HIGH);
|
||||
|
||||
return ChatMessage::fromNotification($this);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,10 @@ class DomainUpdateErrorNotification extends Notification implements ChatNotifica
|
||||
|
||||
public function asChatMessage(?RecipientInterface $recipient = null, ?string $transport = null): ?ChatMessage
|
||||
{
|
||||
$this->subject('Error: Domain Update');
|
||||
$ldhName = $this->domain->getLdhName();
|
||||
$this->subject("Error: Domain Update $ldhName")
|
||||
->content("Domain name $ldhName tried to be updated. The attempt failed.")
|
||||
->importance(Notification::IMPORTANCE_MEDIUM);
|
||||
|
||||
return ChatMessage::fromNotification($this);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,11 @@ class DomainUpdateNotification extends Notification implements ChatNotificationI
|
||||
|
||||
public function asChatMessage(?RecipientInterface $recipient = null, ?string $transport = null): ?ChatMessage
|
||||
{
|
||||
$this->subject('Domain Updated');
|
||||
$ldhName = $this->domainEvent->getDomain()->getLdhName();
|
||||
$action = $this->domainEvent->getAction();
|
||||
$this->subject("Success: Domain Updated $ldhName")
|
||||
->content("Domain name $ldhName information has been updated ($action).")
|
||||
->importance(Notification::IMPORTANCE_HIGH);
|
||||
|
||||
return ChatMessage::fromNotification($this);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,10 @@ class TestChatNotification extends Notification implements ChatNotificationInter
|
||||
{
|
||||
public function asChatMessage(?RecipientInterface $recipient = null, ?string $transport = null): ?ChatMessage
|
||||
{
|
||||
$this->subject('Test notification');
|
||||
$this->content('This is a test message. If you can read me, this Webhook is configured correctly');
|
||||
$this
|
||||
->subject('Test notification')
|
||||
->content('This is a test message. If you can read me, this Webhook is configured correctly')
|
||||
->importance(Notification::IMPORTANCE_LOW);
|
||||
|
||||
return ChatMessage::fromNotification($this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user