Skip to content

Commit b8fe32b

Browse files
committed
chore(notification): improve notification message
Discord, Slack, and Webhook notification already included project/environment. This adds them for Email, Telegram and Pushover.
1 parent 22985e1 commit b8fe32b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/Notifications/Application/DeploymentSuccess.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function toMail(): MailMessage
6868
'fqdn' => $fqdn,
6969
'deployment_url' => $this->deployment_url,
7070
'pull_request_id' => $pull_request_id,
71+
'project' => data_get($this->application, 'environment.project.name'),
72+
'environment' => $this->environment_name,
7173
]);
7274

7375
return $mail;
@@ -130,6 +132,8 @@ public function toTelegram(): array
130132
];
131133
}
132134
}
135+
$message .= "\nProject: ".data_get($this->application, 'environment.project.name');
136+
$message .= "\nEnvironment: {$this->environment_name}";
133137
$buttons[] = [
134138
'text' => 'Deployment logs',
135139
'url' => $this->deployment_url,
@@ -164,6 +168,8 @@ public function toPushover(): PushoverMessage
164168
];
165169
}
166170
}
171+
$message .= "\nProject: ".data_get($this->application, 'environment.project.name');
172+
$message .= "\nEnvironment: {$this->environment_name}";
167173
$buttons[] = [
168174
'text' => 'Deployment logs',
169175
'url' => $this->deployment_url,

0 commit comments

Comments
 (0)