Message is responsible for creating the text message itself. send_sms() was originally the only interfaces django-sms provided. If you wish to use advanced features, you'll need to create Message instances directly. Not all features of the Message class will be available though the send_sms() and related wrapper functions. This sends a text message to +44 1 and +44 1: send_sms ( 'Here is the message', '+12065550100', ) The Message classÄjango-sms' send_sms() function is actually a thin wrapper that makes use of the Message class. The return value will be the number of successfully delivered text messages. See the documentation of SMS backends for more details. If unspecified, an instance of the default backend will be used. connection: The optional SMS backend to use to send the text message.See the SMS backends documentation for a list of possible exceptions. When it's False, send_sms() will raise an exception if an error occurs. recipients: A list of strings, each an phone number.If None, django-sms will use the DEFAULT_FROM_SMS setting. The message, originator and recipients parameters are required. In most cases, you can send text messages using sms.send_sms(). Send_sms( body, originator, recipients, fail_silently=False, connection=None) The text messages are sent using one of the configured SMS backends. In two lines: from sms import send_sms send_sms ( 'Here is the message', '+12065550100', , fail_silently = False ) These wrappers are provided to make sending SMS extra quick, to help test SMS sending during development, and to provide additional SMS gateways. Obtaining an instance of an SMS backend.The module is heavily based upon and structured the same way as the module. Django-sms is a Django app for sending SMS with interchangeable backends.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |