feat: add AfricasTalking SMS adapter#132
Conversation
deepshekhardas
commented
Jun 17, 2026
- New SMS adapter for AfricasTalking API
- Supports sending SMS messages with optional 'from' field
- Handles up to 100 messages per request
- Proper error handling for API responses
- Includes integration tests
- New SMS adapter for AfricasTalking API - Supports sending SMS messages with optional 'from' field - Handles up to 100 messages per request - Proper error handling for API responses - Includes integration tests
Greptile SummaryThis PR adds a new
Confidence Score: 2/5Not safe to merge — the adapter will fail to deliver any SMS in its current state. The core process() method has four independent defects, each sufficient to break every request: the API URL is incorrect and does not resolve to a real endpoint; the + prefix is stripped from recipients that Africa's Talking requires in E.164 format; the from field is sent as null when optional, risking validation rejections; and the missing JSON Accept header means responses arrive as XML, breaking all error-message extraction. src/Utopia/Messaging/Adapter/SMS/AfricasTalking.php requires attention across the API URL constant, phone number mapping, request headers, and body construction. Important Files Changed
Reviews (2): Last reviewed commit: "fix: add parent constructor, type-safe e..." | Re-trigger Greptile |
| if ($result['statusCode'] === 201) { | ||
| $response->incrementDeliveredTo(); | ||
| $response->addResult($recipient); |
There was a problem hiding this comment.
Africa's Talking returns per-recipient statuses in SMSMessageData.Recipients, including failures such as invalid numbers or insufficient balance, while the HTTP request itself can still succeed. This branch marks every 201 response as delivered without reading those recipient statuses, so callers can receive success and an incremented deliveredTo count for messages the provider rejected.
Artifacts
Repro: focused PHP harness mocking a 201 failed-recipient Africa's Talking response
- Contains supporting evidence from the run (text/x-php; charset=utf-8).
Repro: harness execution output showing HTTP 201 Created and adapter success/deliveredTo behavior
- Keeps the command output available without making the summary code-heavy.
…decode to assertResponse