mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-22 11:12:20 +00:00
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\Deployment;
|
|
use App\Models\Site;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class DeploymentCompleted extends AbstractNotification
|
|
{
|
|
public function __construct(protected Deployment $deployment, protected Site $site) {}
|
|
|
|
public function rawText(): string
|
|
{
|
|
return __('Deployment for site [:site] has completed with status: :status', [
|
|
'site' => $this->site->domain,
|
|
'status' => $this->deployment->status,
|
|
]);
|
|
}
|
|
|
|
public function toEmail(object $notifiable): MailMessage
|
|
{
|
|
return (new MailMessage)
|
|
->subject(__('Deployment Completed'))
|
|
->line('Deployment for site ['.$this->site->domain.'] has completed with status: '.$this->deployment->status);
|
|
}
|
|
|
|
public function toSlack(object $notifiable): string
|
|
{
|
|
return $this->rawText();
|
|
}
|
|
|
|
public function toDiscord(object $notifiable): string
|
|
{
|
|
return $this->rawText();
|
|
}
|
|
|
|
public function toTelegram(object $notifiable): string
|
|
{
|
|
return $this->rawText();
|
|
}
|
|
}
|