File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ Secondary Verbs
42
42
.. autoclass :: twilio.twiml.Pause
43
43
:members:
44
44
45
- .. autoclass :: twilio.twiml.Sms
45
+ .. autoclass :: twilio.twiml.Message
46
46
:members:
47
47
48
48
.. autoclass :: twilio.twiml.Enqueue
Original file line number Diff line number Diff line change @@ -45,6 +45,25 @@ All attributes are keyword arguments.
45
45
<Play loop =" 3" >https://api.twilio.com/cowbell.mp3</Play >
46
46
<Response >
47
47
48
+ The Message and Sms verbs are slightly special: because :const: `from ` is a
49
+ Python keyword, use the :const: `sender ` parameter to specify the number
50
+ the message should come from:
51
+
52
+ .. code-block :: python
53
+
54
+ from twilio import twiml
55
+
56
+ r = twiml.Response()
57
+ m = r.message(" Hello MMS Monkey!" , sender = " +14155551234" )
58
+ print str (r)
59
+
60
+ .. code-block :: xml
61
+
62
+ <?xml version =" 1.0" encoding =" utf-8" ?>
63
+ <Response >
64
+ <Message from =" +14155551234" >Hello MMS Monkey!</Message >
65
+ <Response >
66
+
48
67
Python 2.6+ added the :const: `with ` statement for context management.
49
68
Using :const: `with `, the module can *almost * emulate Ruby blocks.
50
69
You can’t perform that action at this time.
0 commit comments