feat: Remove subscription on WhatsApp inbox delete (#11977)

- remove webhook subscription while deleting a whatsapp inbox created
via embedded signup

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Tanmay Deep Sharma
2025-07-24 14:04:19 +04:00
committed by GitHub
parent 420be64c45
commit 8262123481
6 changed files with 235 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ class Channel::Whatsapp < ApplicationRecord
after_create :sync_templates
after_create_commit :setup_webhooks
before_destroy :teardown_webhooks
def name
'Whatsapp'
@@ -105,4 +106,8 @@ class Channel::Whatsapp < ApplicationRecord
# Don't raise the error to prevent channel creation from failing
# Webhooks can be retried later
end
def teardown_webhooks
Whatsapp::WebhookTeardownService.new(self).perform
end
end