feat(breaking): add Vonage Messages API adapter#111
feat(breaking): add Vonage Messages API adapter#111bhardwajparth51 wants to merge 10 commits intoutopia-php:mainfrom
Conversation
Greptile SummaryThis PR adds a new
Confidence Score: 4/5Safe to merge once the backward-compatibility concern for the The new src/Utopia/Messaging/Adapter/SMS/VonageLegacy.php — the deleted Important Files Changed
Reviews (9): Last reviewed commit: "chore: fix static analysis and rename Vo..." | Re-trigger Greptile |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughAdds a new SMS adapter 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/Messaging/Adapter/SMS/VonageMessagesTest.php (1)
30-34: Inconsistent handling ofVONAGE_FROMbetween constructor and message.The constructor fallback (line 27) uses
'Vonage'whenVONAGE_FROMis unset, but the message'sfrom(line 33) receivesfalse(fromgetenv()returning false). This creates an inconsistent test scenario where the adapter'sfromdiffers from the message'sfrom.If the intent is to test the adapter's constructor
fromtaking precedence, the message'sfromcould be explicitly set tonullor omitted. If the intent is to pass matching values, both should use the same fallback.♻️ Suggested clarification
$message = new SMS( to: [$to], content: 'Test Content', - from: \getenv('VONAGE_FROM') + from: \getenv('VONAGE_FROM') ?: null );
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e6eed56d-cd95-4c22-9ff3-18c201ec0c9c
📒 Files selected for processing (3)
src/Utopia/Messaging/Adapter/SMS/VonageMessages.phpsrc/Utopia/Messaging/Adapter/VonageMessagesBase.phptests/Messaging/Adapter/SMS/VonageMessagesTest.php
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@stnguyen90 Ready for review! let me know if it need any additional changes. |
|
i think the CI failures are all pre-existing they're coming from expired or missing github secrets for Twilio, Resend, Sendgrid, Mailgun, Fast2SMS, Inforu, Discord, APNS, and FCM. My Vonage tests are correctly skipping since the VONAGE_* secrets aren't configured in CI yet. |
|
@ChiragAgg5k can you review it |
|
Tip: Greploop — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
c5a14c0 to
815454f
Compare
|
@bhardwajparth51 lets fix the static analysis. also i propose we can make this a breaking change and mark the older adapter as legacy, perhaps |
|
@ChiragAgg5k i have updated the PR. Could you review when you have bandwidth |



What does this PR do?
Adds a new SMS adapter for the Vonage Messages API (v1) and renames the existing legacy adapter to
VonageLegacy.Breaking Change: The older
Vonageadapter has been renamed toVonageLegacy. Users wishing to continue using the legacy SMS API must update their class references.Key details of the implementation:
VonageMessages, which uses the modern Vonage Messages API (v1). This is the recommended approach as it is more cost-effective and versatile.Basicauthentication (Base64 encoded API Key and Secret) specifically for the Messages API endpoint.202 Acceptedstatus code, ensuring robust error handling for successful handoffs.SMSAdapterdirectly, following repository patterns.Test Plan
[OK] No errors.tests/Messaging/Adapter/SMS/VonageMessagesTest.php.tests/Messaging/Adapter/SMS/VonageTest.phptoVonageLegacyTest.php.Authorizationheader and JSON payload composition.Related PRs and Issues
Closes #82
Have you read the Contributing Guidelines on issues?
Yes.