dorzki / slack-notifications

Get WordPress notifications to your team's Slack channel.
https://wordpress.org/plugins/dorzki-notifications-to-slack/
GNU General Public License v3.0
41 stars 27 forks source link

Feature: Multiple Webhooks #45

Open yoavmatchulsky opened 4 years ago

yoavmatchulsky commented 4 years ago

This feature will allow adding multiple webhooks and lets each notification use a different webhook. Issue #43

Slack updated their custom integration and now you can only create a Slack App with Incoming Webhook to a single channel. That means that each channel now needs a specific webhook.

Add a new Webhooks settings page to manage all the webhooks (add, delete and test). Each webhook will have a uniquly generated id, a display title and a url (Channel is no longer needed).

= Webhook Class: = handles getting (#get_webhooks) and updating webhooks (#save_webhooks) and a #random_id helper

= Slack Bot: = The bot instance will now hold all the available webhooks, and will use it when sending a message. The notifications now needs to send additional "webhook_id" arg, or "webhook_url" (used for testing)

= Notification Types: = Keep track of all the webhooks by the notification action in NotificationType base class (as $notif_webhooks), and use it in a new helper #get_notification_webhook_data that returns both the webhook_id and the channel (for older integrations). Refactor all the send_message calls in all notification types to use the new helper and send webhook_id to the bot.

= AJAX: =

= JS: =

= Upgrade: = Refactor #sn_update_plugin_db to run multiple upgrades. Refactor the previous upgrade to #sn_update_plugin_db_200 and add new #sn_update_plugin_db_210 helper.

The upgrade for v2.1.0 will take the previous global webhook and transform it into the new webhooks array, and then update all the notifications to use the new webhook.

elig commented 4 years ago

Yessssss thank you Yaov, much needed improvement👌

DorZuberi commented 4 years ago

Hi Yoav, Thanks for your contribution.

I will go over it and do some tests to ensure everything works fine and i will update soon.

elig commented 4 years ago

Hi Dor, any update on this?

DorZuberi commented 4 years ago

Hi @elig, I haven't forgot about that, I'm a bit packed up at work, I hope to address it by the end of the coming week.

Sorry for the delay.

marmotz commented 4 years ago

Hi @DorZuberi, any news ? I can't use your exension without this PR :-/

herbdogu commented 3 years ago

Little +1/me too, we have a complex configuration and could use some separation on channels.

keinar commented 2 years ago

Hi @DorZuberi , We talked a few months ago .. you did not have time. Do you have time for updates now? :)

DorZuberi commented 2 years ago

Hi Guys, I'm working on a new a much improved plugin version.

I've created dev branch, you can keep track there on my progress, I hope to have it ready by the end of June.

ryanherd commented 2 years ago

Great news! Always here for testing assistance if needed. Good luck

keinar commented 2 years ago

Wow thanks!! I was waiting for it🙏

בתאריך יום ו׳, 20 במאי 2022, 8:46, מאת Dor Zuberi @.***

:

Hi Guys, I'm working on a new a much improved plugin version.

I've created dev branch, you can keep track there on my progress, I hope to have it ready by the end of June.

— Reply to this email directly, view it on GitHub https://github.com/dorzki/slack-notifications/pull/45#issuecomment-1132498314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMAPJ4SKLVLHEWPACPJ7CNTVK4RKHANCNFSM4NGYR2EA . You are receiving this because you commented.Message ID: @.***>

DorZuberi commented 2 years ago

Thanks @ryanherd and @keinar :)