feat(whatsapp): 🎉 Add extended sending and template management
* 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:
@@ -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{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user