Skip to content

Commit

Permalink
add slack attachement pretext attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Feb 8, 2018
1 parent 4fbb54b commit 92a47d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ protected function attachments(SlackMessage $message)
'author_icon' => $attachment->authorIcon,
'author_link' => $attachment->authorLink,
'author_name' => $attachment->authorName,
'pretext' => $attachment->pretext,
'color' => $attachment->color ?: $message->color(),
'fallback' => $attachment->fallback,
'fields' => $this->fields($attachment),
Expand Down
20 changes: 20 additions & 0 deletions src/Illuminate/Notifications/Messages/SlackAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class SlackAttachment
*/
public $content;

/**
* The attachment's pre-text.
*
* @var string
*/
public $pretext;

/**
* A plain-text summary of the attachment.
*
Expand Down Expand Up @@ -141,6 +148,19 @@ public function content($content)
return $this;
}

/**
* Set the Pre-text of the attachment.
*
* @param string $pretext
* @return $this
*/
public function pretext($pretext)
{
$this->pretext = $pretext;

return $this;
}

/**
* A plain-text summary of the attachment.
*
Expand Down

0 comments on commit 92a47d5

Please sign in to comment.