Onit Documentation

Emails and Links Liquid Examples

by David Goldfarb Updated

Approval Button: {{ 'Approve' | button_link : approve_url }}

Reject Button: {{ 'Reject' | button_link : reject_url }}

Note: for these two buttons above to render, they must be in a Send Notification action that is sent to a Role (such as Approver or Actor) and is fired by a Participant Activated Business Rule.

View Request Button: {{ 'View Request' | button_link : view_request_url }}

Add Buttons to Emails

{{ 'Onit' | button_link: 'http://onit.com' }}

You can also embed {{ 'button text' | wizard_link: atom }} in a notification, which will create an anchor link that will take the user directly to the launch form in edit mode without rendering the atom view. See also edit_form, which can be appended to the end of an atom URL and will render the atom in launch form view.

in addition to wizard_link there is wizard_url, e.g., {{ atom | wizard_url }} which will generate a URL instead of a link. The URL can then be used with button_link, e.g., 

{% assign my_url = atom | wizard_url %}{{ 'Press Me' | button_link : my_url }}

wizard_link and wizard_url will always require authentication when sent in a Send Notification Action. If they are used in a Send Report, and "do not require login" is on when the report is generated, then in this case the links can be followed without authenticating.

From a suite

Use widget_atom_link (to render second mover) form or widget_atom_link_popup (render full atom view in popup form.) E.g., 

{{ 'Edit' | widget_atom_link: atom}}

 {{ task.name | widget_atom_link: task }}

Get Email Attachment IDs

This Liquid will get the attachment IDs of documents sent to a Record via email.

{% assign mail_id = atom.emails.last.id %}
{% for doc in documents %}
{% if doc.attachment_owner_id == mail_id %}
{{ doc.id }}
{% endif %}
{% endfor %}

Project Emails

Approve email: {{email_address.account}}[email protected]{{email_address.subdomain}}.app.onit.com

Reject email: {{email_address.account}}[email protected]{{email_address.subdomain}}.app.onit.com

Non-Anonymous attachment download URL

The user must be logged into Onit to use this link, it is not anonymous. 

{% attachment_link generated_document %}

This provides a link to the content of an Attachment Field (in this example named generated_document).

You can also get a link to the attachment provided in a comment:

{% assign comment = comments.last %}{% comment_attachment_link %}

This will present a link that looks like the one in the comment feed, which can be clicked on for a download.

The assign statement here must use specifically comment, and other variables won't work.

The attachment_link and comment_attachment_link tags each verify the recipient address of the email matches the email address of the user downloading the attachment. If the email is forwarded to another person, that person will not be able to download any attachment regardless of permissions in Onit.

This check does not apply to system admins.

Generate Anonymous Attachment Download URL

This Liquid will generate an anonymous URL that will let anyone download the contents of an attachment Field. Parameters: the field name, the expiration period. The expiration period is expressed in days. The default is 45 days. The parameter accepts a decimal: .5 for 12 hours, .001 for 86 seconds, etc. You can also say "never".

{% capture url %}
{% anonymous_attachment_url atom, [attachment field name], [expiration] %}
{% endcapture %}
<a href="{{url}}" download>Anonymous Download Link</a>

Launch App Form from Suite Widget

This Liquid creates a clickable link that will launch an App without navigating the user away from their dashboard. This only works in the context of a suite portal widget, not an atom portal widget.

{{ "click here" | widget_atom_launch: "[app name]" }}

To create anonymous launch with included parameters, use the {% create_launch_url %} tag, along with subtags {% app %} and {% param %}. An example:

{% create_launch_url my_link %}
{% app '[app name]' %}
{% param name = 'Test Atom' %}
{% param requester_name = 'Alice' %}
{% param checkbox = true %}
{% endcreate_launch_url %}

This example constructs a link which is stored in my_link. You can then use my_link in a hyperlink:

<a href = "{{my_link}}">Click Here</a>

Or a button link, as shown above:

{{ 'Click Here' | button_link: my_link }}
Previous Article Working with Fields Liquid Examples
Next Article Miscellaneous Liquid Examples

© 2022 Onit, Inc.

docs.onit.com contains proprietary and confidential information owned by Onit, Inc. that is subject to copyright. Onit presents it exclusively to you for your sole use in conjunction with using Onit products. No portion of the materials contained herein may be used for any other purpose. No portion of the materials contained herein may be shared with third parties or reproduced in any form.