2
0

📝 Add env WHATSAPP_CLOUD_API_URL to possible change https://gr… (#1170)

refs #1117 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Dynamically construct API URLs for WhatsApp features using environment
variables for improved reliability and configurability.
- Updated `sendWhatsAppMessage` function to use
`env.WHATSAPP_CLOUD_API_URL` for URL construction, allowing for more
dynamic configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
This commit is contained in:
Clairton Rodrigo Heinzen
2024-01-25 07:53:57 -03:00
committed by Baptiste Arnaud
parent ef05b71869
commit 47af9a9a59
6 changed files with 20 additions and 10 deletions

5
packages/env/env.ts vendored
View File

@@ -283,6 +283,11 @@ const whatsAppEnv = {
WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID: z.string().min(1).optional(),
WHATSAPP_PREVIEW_TEMPLATE_NAME: z.string().min(1).optional(),
WHATSAPP_PREVIEW_TEMPLATE_LANG: z.string().min(1).optional().default('en'),
WHATSAPP_CLOUD_API_URL: z
.string()
.url()
.optional()
.default('https://graph.facebook.com'),
},
}