YAN is seeking help to customize a webhook to trigger notifications only when posts containing images are created or updated, referencing a plugin for adding new webhooks. pfaffman suggests it’s possible by checking the raw content of posts for images but admits limited knowledge to provide a working example. YAN follows up, noting that the plugin works in principle (notification types appear), but the webhook events (like session) aren’t being triggered, and asks for further guidance.
I’m trying to add a new webhook for posts containing images. Instead of getting notified when new posts are being created/updated, I hope to make the server notified only when there are new posts with images created/updated.
I’m trying to build the feature based on this plugin Add new webhooks and customize webhook payload But I’m not sure whether this is doable. Could anyone offer some help? Any ideas are appreciated!
It looks possible to follow that example to add a new webhook. You’d include code to look at raw in the new post to see if it has an image in it. I don’t quite understand what’s happening in there well enough to give you a working example. I’d start with that and play around to see how to works.
I’ve tested with the examples given(notification and session) but it seems that they are not working… The plugin is added successfully, and the new notification types can be shown on the Webpage. The notification webhook exists without adding the plugin, and the session webhook is not triggered when I log in/out.