We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bd0d51 commit bc5fe07Copy full SHA for bc5fe07
sms/receive-sms.php
@@ -0,0 +1,17 @@
1
+<?php
2
+require_once __DIR__ . '/../config.php';
3
+
4
+require_once __DIR__ . '/../vendor/autoload.php';
5
6
+$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7
+$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
8
9
+$inbound = \Nexmo\Message\InboundMessage::createFromGlobals();
10
11
+if($inbound->isValid()){
12
+ error_log($inbound->getBody());
13
14
+ $client->message()->send($inbound->createReply('Thanks for the SMS!'));
15
+} else {
16
+ error_log('invalid message');
17
+}
0 commit comments