Пример #1
0
    def send_token_url(self, token_url, msisdn):
        """Send a confirmation/token link.
        """
        msg_options = {'helper_metadata': {}}
        # specify this message as being sensitive
        msg_mdh = MessageMetadataDictHelper(msg_options['helper_metadata'])
        msg_mdh.set_sensitive(True)

        yield self.dispatch_command(
            'send_message',
            user_account_key=self.c.user_account.key,
            conversation_key=self.c.key,
            command_data={
                "batch_id": self.batch.key,
                "to_addr": msisdn,
                "msg_options": msg_options,
                "content": ("Please visit %s to start your conversation." %
                            (token_url,)),
                })
        yield self.c.save()