<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spatie / interactive-slack-notification-channel example snippets
public function routeNotificationForInteractiveSlack()
{
return [
'token' => 'xoxp-slack-token',
'channel' => '#general' // this is optional
];
}
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackMessage
public function toInteractiveSlack($notifiable)
{
return (new SlackMessage)->content('A new order has been placed');
}
public function interactiveSlackResponse(array $response)
{
$this->order->update(['slack_thread_ts' => $response['ts']]);
}
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackMessage;
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackAttachment;
public function toInteractiveSlack($notifiable)
{
$order = $this->order;
return (new SlackMessage)
->success()
->content('Order paid')
->threadTimestamp($order->slack_thread_ts)
->attachment(function(SlackAttachment $attachment) use ($order) {
$attachment
->title("Order $order->reference has been paid for.")
->content('Should now be processed.')
->action('View Order', route('orders', $order->reference));
});
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.