CoreShop
CoreShop copied to clipboard
Webhook notification action
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | yes |
| BC Break report? | no |
| RFC? | no |
Pretty simple, a notification action which basically does this:
public function apply($subject, NotificationRuleInterface $rule, array $configuration, array $params = []): void
{
$request = $this->messageFactory
->createRequest('POST', $configuration['url'])
->withHeader('Content-Type', 'application/json')
->withBody($this->streamFactory->createStream(json_encode($this->eventCreator->create($subject, $rule, $params), \JSON_THROW_ON_ERROR)))
;
$this->client->sendRequest($request);
}
@dkarlovi did you implement this? could you create a PR?
I've implemented this on my project, would need to clean it up substantially to PR.
@dkarlovi ?