@classmethod
  @gen.coroutine
  def _CreateViewpointURL(cls, client, recipient_user, identity_key, viewpoint, use_short_domain=False):
    """Creates a Short URL which links to a conversation on the website.

    If "use_short_domain" is true, then return a URL that uses the short domain, along with
    a shorter group_id prefix that will get re-mapped by ShortDomainRedirectHandler.
    """
    # Create ShortURL that sets prospective user cookie and then redirects to the conversation.
    short_url = yield Identity.CreateInvitationURL(client,
                                                   recipient_user.user_id,
                                                   identity_key,
                                                   viewpoint.viewpoint_id,
                                                   default_url='/view#conv/%s' % viewpoint.viewpoint_id)

    # ShortURL's can use either the regular domain or the short domain. For SMS messages, we
    # typically use the short domain. For email, we typically use the regular domain. 
    if use_short_domain:
      assert short_url.group_id.startswith('pr/'), short_url
      raise gen.Return('https://%s/p%s%s' %
                       (options.options.short_domain, short_url.group_id[3:], short_url.random_key))

    raise gen.Return('https://%s/%s%s' % (options.options.domain, short_url.group_id, short_url.random_key))
dataset/ETHPy150Open viewfinderco/viewfinder/backend/op/alert_manager.py/AlertManager._CreateViewpointURL/original