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()
def set_go_helper_metadata(self, helper_metadata=None): if helper_metadata is None: helper_metadata = {} mdh = MessageMetadataDictHelper(helper_metadata) mdh.add_conversation_metadata(self) return helper_metadata
def mk_md(self, message=None, go_metadata=None, optout_metadata=None): if message is None: message = self.mk_msg(go_metadata, optout_metadata) return MessageMetadataDictHelper(message['helper_metadata'])