Skip to content

Commit

Permalink
Use message as default alias hash
Browse files Browse the repository at this point in the history
  • Loading branch information
DavydeVries committed Feb 3, 2022
1 parent 7cf090c commit 2a17641
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/OpsGenie.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ public function message(string $message)
{
$this->object['message'] = (config('opsgenie.prefix') ? '['.config('opsgenie.prefix').'] ' : '').$message;

if (!array_key_exists( 'alias', $this->object)) {
$this->object['alias'] = md5($this->object['message']);
}

return $this;
}

Expand Down Expand Up @@ -391,6 +395,10 @@ public function message(string $message)
{
$this->object['message'] = (config('opsgenie.prefix') ? '['.config('opsgenie.prefix').'] ' : '').$message;

if (!array_key_exists( 'alias', $this->object)) {
$this->object['alias'] = md5($this->object['message']);
}

return $this;
}

Expand Down

0 comments on commit 2a17641

Please sign in to comment.