File tree Expand file tree Collapse file tree
src/Utopia/Messaging/Adapter/SMS
tests/Messaging/Adapter/SMS Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99/**
1010 * Vonage Messages API SMS Adapter.
1111 *
12- * Uses the newer Vonage Messages API (V1) instead of the older SMS API.
13- * The Messages API is cheaper and supports multiple message types .
12+ * This adapter uses the modern Vonage Messages API (V1) which is more cost-effective
13+ * and versatile than the legacy SMS API .
1414 *
15- * Reference: https://developer.vonage.com/en/api/messages
15+ * @link https://developer.vonage.com/en/api/messages
1616 */
1717class VonageMessages extends SMSAdapter
1818{
@@ -30,23 +30,23 @@ public function __construct(
3030 }
3131
3232 /**
33- * Get the API endpoint for the Vonage Messages API.
33+ * Vonage Messages API endpoint .
3434 */
3535 protected function getApiEndpoint (): string
3636 {
3737 return 'https://api.vonage.com/v1/messages ' ;
3838 }
3939
4040 /**
41- * Get the authorization header value for the API request .
41+ * Generates the Basic Authorization header .
4242 */
4343 protected function getAuthorizationHeader (): string
4444 {
4545 return 'Basic ' . \base64_encode ("{$ this ->apiKey }: {$ this ->apiSecret }" );
4646 }
4747
4848 /**
49- * Build the request headers for the Messages API.
49+ * Sets common headers for the API request .
5050 *
5151 * @return array<string>
5252 */
Original file line number Diff line number Diff line change 99class VonageMessagesTest extends Base
1010{
1111 /**
12+ * Tests sending an SMS with the 'from' number set directly in the adapter.
13+ *
1214 * @throws \Exception
1315 */
1416 public function testSendSMS (): void
@@ -38,6 +40,8 @@ public function testSendSMS(): void
3840 }
3941
4042 /**
43+ * Tests sending an SMS where the 'from' number is provided by the message object.
44+ *
4145 * @throws \Exception
4246 */
4347 public function testSendSMSWithFallbackFrom (): void
You can’t perform that action at this time.
0 commit comments