(self, from_, to, context)
return sms_send_api.format(
            authkey=self.auth_key,
            mobiles=','.join(str(mobile) for mobile in to),
            message=context.get('body', ''),
            sender=from_,
            route=route,
            country=context.get('country', '')
        )
Prepare msg91 message with necessary information.
Prepare msg91 message with necessary information.
Prepare msg91 message with necessary information .
def _prepare_sms_message(self, from_, to, context):
        """Prepare msg91 message with necessary information.
        """
        sms_send_api = getattr(settings, 'MSG91_SMS_SEND_API')

        if type(to) is not list:
            to = [to, ]

        route = getattr(settings, 'MSG91_TRANSACTIONAL_ROUTE', 4)
        if context.get('transaction_message') is False or context.get('transaction_message') is None:
            route = getattr(settings, 'MSG91_PROMOTIONAL_ROUTE', 1)

        if context.get('country') is None:
            raise ValueError('country not found in context.')

        return sms_send_api.format(
            authkey=self.auth_key,
            mobiles=','.join(str(mobile) for mobile in to),
            message=context.get('body', ''),
            sender=from_,
            route=route,
            country=context.get('country', '')
        )
def _prepare_sms_message ( self , from_ , to , context ) : sms_send_api = getattr ( settings , 'MSG91_SMS_SEND_API' ) if type ( to ) is not list : to = [ to , ] route = getattr ( settings , 'MSG91_TRANSACTIONAL_ROUTE' , 4 ) if context . get ( 'transaction_message' ) is False or context . get ( 'transaction_message' ) is None : route = getattr ( settings , 'MSG91_PROMOTIONAL_ROUTE' , 1 ) if context . get ( 'country' ) is None : raise ValueError ( 'country not found in context.' ) return sms_send_api . format ( authkey = self . auth_key , mobiles = ',' . join ( str ( mobile ) for mobile in to ) , message = context . get ( 'body' , '' ) , sender = from_ , route = route , country = context . get ( 'country' , '' ) )