Tokens

Use Tokens to customize emails and forms with variables from Pubs and your Community.

Tokens are shorthand variables that users can use to refer to community-specific Fields. When configuring an email Action or configuring paragraphs within Forms, users can use Tokens to display values of specific Pub Fields. 

Tokens use a colon character (:) to indicate the start of a Token, followed by one of the Token-values. The system will highlight a token in blue if the syntax is recognized, though it does not mean the value of the Token (e.g., a url) is validated nor that it has any value.

Configuring an Email action with Tokens

There are three Token-values:

  • field values (i.e., text)
  • links (i.e., urls)
  • email-specific values

Field Tokens

Field Token values draw on the Field Names of the associated Pub. The Field Name syntax is rendered as commuunity:name. For example, to use the Pub Title in the PubPub Community, the Field Name syntax would be pubpub:title;. As a reminders, users can view all active Fields in the Community via the Fields Dashboard.

To add a field value token, include the colon, value and the field name after = in {field=}. The token will be replaced in the email as text. For example, to include the value of the Title field, enter:

:value{field=pubpub:title}


Link Tokens

Link tokens render their values as hyperlinks. 

To add a link token, include the colon, link and the field name after = in {field=}. The token will be replaced in the email as a live link. For example, to include a URL, enter :link{field=pubpub:url}

To render link tokens with a text anchor, include a text value within quotes inside the curly brackets. If no text value is included, the full link will display by default. For example, to use “here” as the link anchor, enter :link{field=pubpub:url text="here"}

There are four additional link token types:

  • To add a specified URL, replace field with to. For example, to link to PubPub Platform, enter :link{to=https://app.pubpub.org}
  • To link to a page within PubPub Platform, replace field with page and provide the page's slug. For example, to link to the Types Dashboard, enter :link{page='types'}. Options include ‘currentPub’ to link to the current Pub, ‘allPubs’ to link to the All Pubs View, ‘allStages’ to link to the All Workflows View. 
  • To link to a form in a Community, replace field with form. For example, to link to the Invitation form, enter :link{form=invitation}.
  • To add an email link (i.e., mailto:), replace field with email. For example, to add a clickable email address, enter: :link{email=help@pubpub.org}

Field values can be used as anchors for link tokens. To provide a Pub title with a hyperlink, enter:

:link[:value{field="pubpub:title"}]{field="pubpub:url"}

 


Email-specific Tokens

You can also add tokens for values specific to the email Action, such as a sender or recipient's name. These tokens include the initial colon (:), followed by the token name. For example, to add the recipient's first name, enter :RecipientFirstName

The email-specific tokens are:

  • RecipientName
  • RecipientFirstName
  • RecipientLastName

 

How token values appear elsewhere

 

Tips

  • If a token is used in an Action, but that value does not exist in the Pub, the Action will fail. For example, if an email Action includes a field value token for pubpub:description, but pubpub:description is not a field in the community or does not have a value for the particular Pub it is used on, the email Action will fail to run.
  • If a token is used in a Form's paragraph element, but that value does not exist in the Pub, any Markdown in the Paragraph element will be invalidated.