Permalink
Browse files

(New) Add "from" as a sender key

  • Loading branch information...
1 parent a7518ca commit 7ad08e30f93b3427af3b7c668344a657d01168ba Adam Kalsey committed Mar 4, 2011
Showing with 7 additions and 1 deletion.
  1. +2 −0 readme.markdown
  2. +5 −1 simpleMessage.php
View
@@ -36,6 +36,8 @@ adding the following query string variables
* to - the phone number (including country code) to send to
* msg - the message to send
* network - (optional) the network to send to. Defaults to SMS
+ * from - (optional) if you have multiple Tropo numbers, which one to send
+from. **Note** this must be a Tropo number. Carriers reject spoofed SMS messages.
Since this is a URL, all values should be URL encoded.
View
@@ -24,7 +24,11 @@
if ($action == 'create') {
// this is an outgoing message
- message($msg, array('to' => $to, 'network' => $network));
+ $opts = array('to' => $to, 'network' => $network);
+ if (!empty($from)) {
+ $opts['from'] = $from;
+ }
+ message($msg, $opts);
} else {
// this is an incoming message, capture output.
answer();

0 comments on commit 7ad08e3

Please sign in to comment.