@urlAlias::activate

Reduces URL components to an encoded, short URL within the content of a notification.

Syntax:

@urlAlias::activate()

Parameters:

None

Returns:

(String) The transformed URL

Example:

The following example illustrates how to use the activate method of the URL Alias Script Object to transform the various components of a Mobile Gateway URL to a short URL.

@person = @event::getRecipient($recipient.owner)

  $hasMobileAccess = $person.hasMobileAccess

  $accessibleServices = @person::getAccessibleIntegrationServices($event.domain)  

  $hasAccessToSample = $accessibleServices::contains("sample")  

 

  IF ($hasMobileAccess && $hasAccessToSample)

    @urlAlias = @event::createURLAlias()  

    @urlAlias::setTarget("http://localhost:8888/mg/jsp/sample/executePing.jsp")

    @urlAlias::setHost("http://localhost:8888")

    @urlAlias::setTimeout(3600)

    @urlAlias::setParameter("username", $person.targetName)

    @urlAlias::setParameter("command", "dir")

    $alias = @urlAlias::activate()  

    $content.message = $content.message & " Link: " & $alias  

  ENDIF