Skip to content

[Notifier][Slack] Add fields on Slack Section block #36154

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

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

birkof
Copy link
Contributor

@birkof birkof commented Mar 21, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR

Added fields field on section block.

An array of text objects. Any text objects included with fields will be rendered in a compact format that allows for 2 columns of side-by-side text. Maximum number of items is 10. Maximum length for the text in each item is 2000 characters.

Example of use:

$slackOptions = (new SlackOptions())
            ->block((new SlackSectionBlock())->text('My message'))
            ->block(new SlackDividerBlock())
            ->block(
                (new SlackSectionBlock())
                    ->field('*Max Rating*')
                    ->field('5.0')
                    ->field('*Min Rating*')
                    ->field('1.0')
            );

Expected output:

Screen Shot 2020-03-21 at 09 57 36

@fabpot
Copy link
Member

fabpot commented Mar 23, 2020

Thank you @birkof.

@fabpot fabpot merged commit 0076ed5 into symfony:master Mar 23, 2020
@birkof birkof deleted the slack-fields-section-block branch April 4, 2020 20:29
@birkof
Copy link
Contributor Author

birkof commented Apr 4, 2020

@fabpot due some limitations on these fields, I have added one minor fix: #36347

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
@fabpot fabpot mentioned this pull request May 5, 2020
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Apr 15, 2021
…tark)

This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Docs for Slack options field() method

Closes #13398

Example and image taken from symfony/symfony#36154 (comment)

cc `@birkof` as you provided this feature

Commits
-------

d39b477 Docs for Slack options field() method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants