Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve Discord notifications #3269

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions app/Notifications/Application/DeploymentSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct(Application $application, string $deployment_uuid, ?
$this->preview = $preview;
$this->application_name = data_get($application, 'name');
$this->project_uuid = data_get($application, 'environment.project.uuid');
$this->project_name = data_get($application, 'environment.project.name');
$this->environment_name = data_get($application, 'environment.name');
$this->fqdn = data_get($application, 'fqdn');
if (str($this->fqdn)->explode(',')->count() > 1) {
Expand Down Expand Up @@ -81,17 +82,13 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
if ($this->preview) {
$message = 'Coolify: New PR'.$this->preview->pull_request_id.' version successfully deployed of '.$this->application_name.'

';
$message = 'Coolify: New PR`'.$this->preview->pull_request_id.'` version successfully deployed of **'.$this->project_name.'** - **'.$this->application_name.'**\n\n';
if ($this->preview->fqdn) {
$message .= '[Open Application]('.$this->preview->fqdn.') | ';
}
$message .= '[Deployment logs]('.$this->deployment_url.')';
} else {
$message = 'Coolify: New version successfully deployed of '.$this->application_name.'

';
$message = 'Coolify: New **'.$this->environment_name.'** version successfully deployed of **'.$this->project_name.'** - **'.$this->application_name.'**\n\n';
if ($this->fqdn) {
$message .= '[Open Application]('.$this->fqdn.') | ';
}
Expand Down