Skip to content

Commit

Permalink
Merge pull request #156 from humanmade/add-support-internal-link
Browse files Browse the repository at this point in the history
Add internal docs link type for support tickets
  • Loading branch information
roborourke authored Aug 12, 2020
2 parents 3ff24d2 + bb52a8e commit 9320699
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ For example, to link to the current user's profile page:
```md
[View your profile](internal://admin/profile.php)
```


## Link to support

You can easily display a direct link to the Altis support ticket system, pre-filled with the current environment stack name.

These links use the special `support://` URL scheme, followed by the keyword `new`:

```md
[Open a support ticket](support://new)
```
13 changes: 13 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ function convert_internal_link( $url ) {
}
break;

case 'support':
$map = [
'new' => 'https://dashboard.altis-dxp.com/#/support/new',
];
$new_url = $map[ $host ] ?? null;
if ( empty( $new_url ) ) {
return $url;
}

$stack_name = Altis\get_environment_name();
$new_url .= '?applications[]=' . urlencode( $stack_name );
break;

default:
return $url;
}
Expand Down

0 comments on commit 9320699

Please sign in to comment.