Replies: 1 comment
-
It's not a bad idea to return the id. You should get an array for the Model key being notified, and the Notification ID. You can follow the breadcrumbs from $id = Notification::route('slackapp', 'the-slack-channel')->notify(new RequestCreated()); It would take time to introduce since it looks more like a Breaking Change to the You may want to make a PR to 9.x |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I write a lot of slack integration, and I have created a Notification Channel that is used by a BOT. When the bot ID posts a message to slack, I want to capture the resulting message ID that slack returns and store it (for later usage).
I've also created my Slack Integration as a composer module, so that it can be the base for multiple implementations and extended as appropriate.
My Slack Channel logic is in the composer module, but its called by the local application:
$result = Notification::route('slackapp',$co)->notify(new RequestCreated($this->o));
(Here $result is NULL, even though in the send() method of the Channel Send object is returning the result of the bot posting the message.)
In my case, I want to use the result (which is the slack post message id) - but another use case might be to send it via an alternative notification route, if this one failed.
My request, can notify() be changed to return the result of the send() call (and thus leave it up to the app developer whether to ignore it or not).
Beta Was this translation helpful? Give feedback.
All reactions