From faad197e85f750eeffcd9c7fb2d59c1a2099acde Mon Sep 17 00:00:00 2001 From: Daniel STANCU Date: Sat, 21 Mar 2020 09:46:58 +0200 Subject: [PATCH] Added fields on Slack Section block --- .../Bridge/Slack/Block/SlackSectionBlock.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php b/src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php index 4bda10f905..09b2ed46c8 100644 --- a/src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php +++ b/src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php @@ -34,6 +34,19 @@ final class SlackSectionBlock extends AbstractSlackBlock return $this; } + /** + * @return $this + */ + public function field(string $text, bool $markdown = true): self + { + $this->options['fields'][] = [ + 'type' => $markdown ? 'mrkdwn' : 'plain_text', + 'text' => $text, + ]; + + return $this; + } + /** * @return $this */