Open likeabas opened 7 months ago
@aalbarca I've added a method to request whatsapp templates. Furthermore, I've used enums and updated the requirements to PHP => 8.1 (as PHP 7 is no longer supported), so it should probably mean a version bump. Furthermore, I've updated the docs a bit.
@aalbarca do you know how I can update the PHP version of the CI?
Hey there @likeabas thank you for this contribution this is exactly what I needed.
@aalbarca I've added a method to request whatsapp templates. Furthermore, I've used enums and updated the requirements to PHP => 8.1 (as PHP 7 is no longer supported), so it should probably mean a version bump. Furthermore, I've updated the docs a bit.
I don't think this will be merged if the author @aalbarca still wants to support PHP 7.4. And if you ask me, I love the most recent versions of PHP, but you can't always update your PHP version if you are in production. PHP 7.4 is still widespread and supporting it still matters in 2024.
How about rolling back the "enum" part? Note the author is already using a PHP package that allows you to use enums as if they were PHP 8.0 native enums. See this for instance. I assume that supporting only PHP 8.0 would require you to refactor the whole code with native enums (and I assume it should be a separate issue / PR / milestone).
Nevertheless, this PR is awesome. @aalbarca what do you think of it?
By the way @likeabas aren't template status & template category different?
If you see the official Meta Docs, you can pass both indeed.
Quoting the docs:
array<enum {ACCOUNT_UPDATE, PAYMENT_UPDATE, PERSONAL_FINANCE_UPDATE, SHIPPING_UPDATE, RESERVATION_UPDATE, ISSUE_RESOLUTION, APPOINTMENT_UPDATE, TRANSPORTATION_UPDATE, TICKET_UPDATE, ALERT_UPDATE, AUTO_REPLY, TRANSACTIONAL, OTP, UTILITY, MARKETING, AUTHENTICATION}>
array<enum {APPROVED, IN_APPEAL, PENDING, REJECTED, PENDING_DELETION, DELETED, DISABLED, PAUSED, LIMIT_EXCEEDED, ARCHIVED}>
This change allows to request all available templates. The
WHATSAPP_CLOUD_API_BUSINESS_ID
should be set to make it work.It touches upon https://github.com/netflie/whatsapp-cloud-api/discussions/182