feat(whatsapp): 🎉 Add extended sending and template management
Some checks failed
CI / Test (1.23) (push) Failing after -24m15s
CI / Test (1.22) (push) Failing after -24m12s
CI / Build (push) Successful in -26m47s
CI / Lint (push) Successful in -26m36s

* Implemented new endpoints for sending various message types:
  - Audio
  - Sticker
  - Location
  - Contacts
  - Interactive messages
  - Template messages
  - Flow messages
  - Reactions
  - Marking messages as read

* Added template management endpoints:
  - List templates
  - Upload templates
  - Delete templates

* Introduced flow management endpoints:
  - List flows
  - Create flows
  - Get flow details
  - Upload flow assets
  - Publish flows
  - Delete flows

* Added phone number management endpoints:
  - List phone numbers
  - Request verification code
  - Verify code

* Enhanced media management with delete media endpoint.

* Updated dependencies.
This commit is contained in:
Hein
2026-02-03 18:07:42 +02:00
parent 98fc28fc5f
commit a7a5831911
16 changed files with 2024 additions and 48 deletions

View File

@@ -132,6 +132,18 @@ func MessageReadEvent(ctx context.Context, accountID, messageID, from string, ti
})
}
// TemplateStatusUpdateEvent creates a template status update event
func TemplateStatusUpdateEvent(ctx context.Context, accountID, templateName, templateID, language, status string, rejectionReasons []string) Event {
return NewEvent(ctx, EventTemplateStatusUpdate, map[string]any{
"account_id": accountID,
"template_name": templateName,
"template_id": templateID,
"language": language,
"status": status,
"rejection_reasons": rejectionReasons,
})
}
// HookTriggeredEvent creates a hook triggered event
func HookTriggeredEvent(ctx context.Context, hookID, hookName, url string, payload any) Event {
return NewEvent(ctx, EventHookTriggered, map[string]any{

View File

@@ -27,6 +27,9 @@ const (
EventMessageDelivered EventType = "message.delivered"
EventMessageRead EventType = "message.read"
// Template events
EventTemplateStatusUpdate EventType = "template.status_update"
// Hook events
EventHookTriggered EventType = "hook.triggered"
EventHookSuccess EventType = "hook.success"
@@ -88,6 +91,7 @@ func (eb *EventBus) SubscribeAll(subscriber Subscriber) {
EventMessageFailed,
EventMessageDelivered,
EventMessageRead,
EventTemplateStatusUpdate,
EventHookTriggered,
EventHookSuccess,
EventHookFailed,