[ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), 'imageStyle' => 'IMAGE' ], 'sections' => [ 'widgets' => [ 'keyValue' => [ 'topLabel' => get('chat_line1'), 'content' => get('chat_line2'), 'contentMultiline' => false, 'bottomLabel' => 'started', // Use 'iconUrl' to set a custom icon URL (png) 'icon' => 'CLOCK', 'button' => [ 'textButton' => [ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ 'url' => get('hostname') ] ] ] ] ] ] ] ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); }) ->once() ->hidden(); desc('Notifies Google Hangouts Chat about deploy finish'); task('chat:notify:success', function () { if (!get('chat_webhook', false)) { return; } $card = [ 'header' => [ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), 'imageStyle' => 'IMAGE' ], 'sections' => [ 'widgets' => [ 'keyValue' => [ 'topLabel' => get('chat_line1'), 'content' => get('chat_line2'), 'contentMultiline' => false, 'bottomLabel' => 'succeeded', // Use 'iconUrl' to set a custom icon URL (png) 'icon' => 'STAR', 'button' => [ 'textButton' => [ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ 'url' => get('hostname') ] ] ] ] ] ] ] ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); }) ->once() ->hidden(); desc('Notifies Google Hangouts Chat about deploy failure'); task('chat:notify:failure', function () { if (!get('chat_webhook', false)) { return; } $card = [ 'header' => [ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), 'imageStyle' => 'IMAGE' ], 'sections' => [ 'widgets' => [ 'keyValue' => [ 'topLabel' => get('chat_line1'), 'content' => get('chat_line2'), 'contentMultiline' => false, 'bottomLabel' => 'failed', // Use 'iconUrl' to set a custom icon URL (png) // or use 'icon' and pick from this list: // https://developers.google.com/hangouts/chat/reference/message-formats/cards#customicons 'button' => [ 'textButton' => [ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ 'url' => get('hostname') ] ] ] ] ] ] ] ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); }) ->once() ->hidden();