ctml haven't got it working I don't know the exact behaviour, but I have some private areas for admins, and public for all users. I'd like to fire webhooks for actions happening in the public area, whether they be by an admin or user, but not fire webhooks for admin actions in the private admin area as these webhooks go to public spaces.

This is kind of implemented, but much less customizable. You can choose between stuff guests can access & stuff admins can access (which includes what guests can access).

I do want to add the option to filter hooks by tag.

ctml Another enhancement could be templates for these hooks, similar to the pretty mail templates, you can use the relevant event data and build your own template, so you can customize the data/layout being sent to the already supported webhook destinations.

This is harder to do because it'd require making the text you input be replaced with some code. It can be done so that you write code, but that's unsafe and you could easily break things. I've thought about it, but I'm not planning on adding this anytime soon.


I'll look into the issue you're having. It'll probably be fixed when I update this extension for beta 14 (after it comes out).

    datitisev

    Thanks, I will wait for the next beta and update to test the extension again!

    It can be done so that you write code

    I am not sure if the FoF PrettyMail code could be leveraged, for the email templates there is some blueprint feature that handles the replacement of the variables holding the data. I don't know if that actually comes from the extension, or really that part is just part of the core email notifications they are making use of. Anyways, I understand some of this stuff probably requires a lot of work which extension developers don't have time for. I hope someday to learn about flarums extension api and trying to build some of my own and submit PR's for others 🙂

      ctml The thing is the PrettyMail code is Blade. It can still have PHP, so if you have a rogue admin it could be unsafe as they can run any PHP when that executes. The same would apply here, but it'd just be plain PHP. I could probably make some system so that you can access all the variables similarly 🤷 or maybe blade would somehow work too, I don't know. I haven't thought too much about it.

      Apologies if nothing above made sense 😆

      • ctml replied to this.

        A general http post webhook with all relevant data posted in json would be a good feature as well, then the user can handle the event/data however they'd like.

          ctml That's currently available in the pro version (reflar/webhooks-pro) on Extiverse. I don't think I ever made a discussion for it here. The problem with that is that it's not the same as an API response, so it has weird logic and sometimes doesn't work completely depending on the event and the payload.

          I got an important message from Discord (you know it, I'm using their APIs) about the API domain migration last July 18. On November 7, they'll be dropping support for the discordapp.com in favor of discord.com and if the plugin still asks for the discordapp.com domain and attempt to send requests beyond that date, errors will fire up in the console.

          Related Issue: ReFlar/webhooks21

          4 days later

          Hey! When I enable the extension the discussions/post won't get posted at once. It asks for a reload. Once the reload is done the discussions/post gets posted and the message is sent to discord. But when I disable the extension everything works fine... Have I done something wrong?

            You can also enable debug in config.php and try again to have the error displayed on screen.

            If it's not logged, it's either a javascript error instead of backend error. Or it's a backend error and the log folder isn't writable.

              EvilExecutor That's... interesting... and doesn't really show where the error comes from. At a glance it doesn't seem like its' an issue with webhooks but a dependency of it. 🤔

              EvilExecutor seems like this is the same issue googleapis/google-api-php-client1392, https://stackoverflow.com/q/50898330

              You could try running composer update guzzlehttp/guzzle --with-dependencies to update Guzzle to the latest possible version for your setup and see whether the issue goes away.

              From those linked threads, it seems updating to Guzzle 6.3 or higher is necessary to fix the issue. You can use composer show guzzlehttp/guzzle --tree to check which version of Guzzle and its dependencies are installed.

              EvilExecutor Good news! However I wouldn't recommend using require, because now it's hard-coded in your composer.json and could prevent an update later on when all extensions move to Guzzle version 7.

              You can simply remove the line about guzzle in your composer.json to fix this problem.

              12 days later

              Is there any support for by tag?

              Like so it only sends the webhook if it had a tag.

                7 days later