Closed Jasonlbc closed 4 years ago
This block works
'blocks' => json_encode([ [ "type"=> "section", "text"=> [ "type"=> "mrkdwn", "text"=> "Hello" ] ], [ "type"=> "actions", "elements"=> [ [ "type"=> "button", "text"=> [ "type"=> "plain_text", "text"=> "Click Here", "emoji"=> false ] ] ] ] ]),
trying to send buttons as messages, but nothing happens. Code is based off of the example [https://api.slack.com/reference/block-kit/block-elements#button]
$result = $client->chatPostMessage([ 'username' => 'Bot', 'channel' => 'general', 'text' => 'Hello', 'blocks' => json_encode([ [ "type"=> "button", "text"=> [ "type"=> "plain_text", "text"=> "Click Me" ], "value"=> "click_me_123", "action_id"=> "button" ]) ] ]);