8000 Update docs for TwiML message generation · derickc/twilio-python@f60e4b7 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f60e4b7

Browse files
committed
Update docs for TwiML message generation
1 parent 97a66c8 commit f60e4b7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/api/twiml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Secondary Verbs
4242
.. autoclass:: twilio.twiml.Pause
4343
:members:
4444

45-
.. autoclass:: twilio.twiml.Sms
45+
.. autoclass:: twilio.twiml.Message
4646
:members:
4747

4848
.. autoclass:: twilio.twiml.Enqueue

docs/usage/twiml.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ All attributes are keyword arguments.
4545
<Play loop="3">https://api.twilio.com/cowbell.mp3</Play>
4646
<Response>
4747
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+
4867
Python 2.6+ added the :const:`with` statement for context management.
4968
Using :const:`with`, the module can *almost* emulate Ruby blocks.
5069

0 commit comments

Comments
 (0)
0