diff --git a/CHANGELOG.md b/CHANGELOG.md index 8edec3a0..ea364cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ * Update Dockerfile * If you pass empty events in create instance and set webhook it is understood as all * Fixed issue that did not output base64 averages +* Messages sent by the api now arrive in chatwoot ### Integrations diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index 0a951add..f2fad12c 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -678,6 +678,7 @@ export class WAStartupService { instance: this.instance.name, data, destination: this.localWebhook.url, + ISODatetime: new Date().toISOString(), sender: this.wuid, server_url: serverUrl, apikey: (expose && instanceApikey) || null, @@ -1991,13 +1992,9 @@ export class WAStartupService { this.logger.verbose('Sending data to webhook in event SEND_MESSAGE'); await this.sendDataWebhook(Events.SEND_MESSAGE, messageRaw); - // if (this.localChatwoot.enabled) { - // this.chatwootService.eventWhatsapp( - // Events.SEND_MESSAGE, - // { instanceName: this.instance.name }, - // messageRaw, - // ); - // } + if (this.localChatwoot.enabled) { + this.chatwootService.eventWhatsapp(Events.SEND_MESSAGE, { instanceName: this.instance.name }, messageRaw); + } this.logger.verbose('Inserting message in database'); await this.repository.message.insert(