When configuring an email Action or configuring paragraphs within Forms, you can use Tokens to pull in specific values.
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.
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
;. You can see all the Field Names in the Community using 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 a Pub title, enter:
:value{field=pubpub:title}
Field values can be used as anchors for link tokens. To provide a Submission title with a hyperlink (and quotation marks), enter:
:link[“:value{field=pubpub:title}”]{field=pubpub:url}
Field values can also be used from related Pubs. For example, to include a title from a parent Pub in an email Action for a child Pub, enter:
:value{field="pubpub:title" rel="parent"}
Link Tokens
Links values draw on the Field Names of the associated Pub. The Field Name syntax is rendered as category:name
. For example, to use the Pub Title, the Field Name syntax would be pubpub:title
;. You can see all the Field Names from Types in the Community using the Types Dashboard.
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, add the text in square brackets [anchor text]
after :link
. For example, to use “here” as the link anchor, enter :link[here]{field=pubpub:url}
There are three additional link token types:
- To add a specified URL, replace
field
withto
. For example, to link to PubPub Platform, enter:link[PubPub Platform]{to=https://app.pubpub.org}
- To link to a form in a Community, replace
field
withform
. For example, to link to the Invitation form, enter:link{form=invitation}
. - To add an email link (i.e.,
mailto:
), replacefield
withemail
. For example, to add a clickable email address, enter::link{email=help@pubpub.org}
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
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
, butpubpub: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, but that value does not exist in the Pub, any Markdown in the Paragraph element will be invalidated.