---
title: "Creating hyperlinks"
description: "Add static or dynamic clickable hyperlinks and email links with custom display text to templates."
canonical_url: "https://resources.docmosis.com/template-tutorials/hyperlinks"
last_reviewed: 2026-06-08
---

# Creating hyperlinks

Docmosis can add hyperlinks and mailto links to documents, where the URL can be static or dynamic. With a static hyperlink the URL is known in advance.  For a dynamic hyperlink, the URL is provided by the data at the time the document is generated.

## Static hyperlinks

A pre\-defined hyperlink can appear in a document by inserting a hyperlink in to the template using the features available in the template editor. Both Microsoft Word and LibreOffice provide the ability to set the hyperlink URL and control the clickable text used for the hyperlink.

The hyperlink in the generated document will be exactly the same as that in the template and will be formatted in the hyperlink style.

## Dynamic hyperlinks

A dynamic hyperlink can be created during the document generation process. Docmosis will insert a hyperlink using a URL provided in the data.

When creating a placeholder, that will result in a dynamic hyperlink, the prefix "link:" appears first, followed by the data item that will be providing the URL.  For example this: \<\\>, will create a hyperlink based on the companyWebsite value in the data..

In the example the data contains "URL1":"https://www.amazon.com". The template field \<\\> will result in the hyperlink : "https://www.amazon.com" appearing in the generated document.

By default, the clickable text that appears in the generated document is the same as the link supplied in the data.

### Setting the clickable text for the hyperlink

Extra information can be provided in the data that will be used by Docmosis when creating the clickable text in the generated document.

The data should contain two parts, separated by the pipe "\|" symbol:

- the clickable text to display
- the URL that will be used for the hyperlink

In the example, the data contains these three elements: 

### Hyperlink to an email address

Docmosis can insert a link which, when clicked, opens a new email addressed to a specified recipient.

In the template the \<\

It links to Google in both the template and the finished document.

**Dynamic Hyperlinks**

**Regular Hyperlinks**

A hyperlink field starts with \<\\>

**Display Text**

Display text may be used instead of showing the target URL. To use display text, the data may include the text and then the URL, separated by a pipe symbol (\|).

In JSON format, the data for this looks like:

\
"URL2":"eBay\|https://www.ebay.com"

In this case the text “eBay” will display in the final document, and clicking this text will take you to https://www.ebay.com.

This link field is set by “URL2”, with alternative display text: \<\\>

**Email Hyperlinks**

Mailto: links are also supported. The field format is exactly the same, only the data is changed.

This is an example mailto link set by “URL3”: \<\\>

You may choose to use display text for a mailto link in order to hide the mailto part as follows:

\
"URL3":"example@example.com\|mailto:example@example.com"
```