Skip to content

Consolidated email ​

Available in4.21.0 +

The consolidated email (consolidated_email template, @{notificationType} = CONSOLIDATED_EMAIL) groups several notifications of a recipient in a single email. Its template receives all the common variables, and the content of the email in @{vars}.

The server provides:

Existing themes that use the flat lists keep working.

Top-level variables ​

VariableDescription
vars.usernameUser name of the recipient.
vars.userfullnameFull name of the recipient.
vars.domainnameDomain of the recipient.
vars.login_urlLogin link of the recipient.
vars.imagesurlBase URL of the web interface, used to load images.
vars.themeWeb interface theme of the recipient.
vars.solutionNameName of the solution, same as @{solutionName}.
vars.supportEmailSupport email address, same as @{supportEmail}.

Flat lists ​

Each list contains the elements of one type of notification. A list without elements is empty.

ListElementsNotification
vars.filesAvailableFile availableFiles available in an inbox and in a community, together. This list is a sorted set (by sender full name, then file name).
vars.filesAvailableNodeFile availablefile_available
vars.filesAvailableCommunityFile availablefile_available_comm
vars.receptionsAcknowledgedFile downloadedreception_acknowledge
vars.filesDeletedFile deletedfile_deleted
vars.filesWillBeDeletedFile will be deletedfile_will_be_deleted
vars.communitiesDeletedCommunity deletedcommunity_deleted
vars.communitiesWillBeDeletedCommunity will be deletedcommunity_will_be_deleted
vars.usersAddedToShareInvitation to a share spaceuser_share
vars.directAccessTokensAvailableDirect access availabledirect_access_available
vars.accountsWillBeInactiveAccount will be locked or deletedaccount_will_be_inactive
vars.accountsWillBeDeletedAccount will be locked or deletedaccount_will_be_deleted
@foreach{item : vars.filesDeleted}
  @{item.filename}<br/>
@end{}

Fields of the elements ​

The fields of each element (item.*) have the same meaning as the variables of the corresponding notification. See Variables by notification. A field that does not apply to an element is null, and MVEL would write it as null: test it with @if{item.field != empty} before displaying it. A list is tested the same way, for example @if{vars.filesDeleted != empty}. The fields that correspond to variables that carry the Version flag required badge in Variables by notification are empty until the Version 4.21 version flag is enabled.

The tables below list every field of each element.

File available ​

FieldDescription
filenameName of the file.
sendername, sendershortname, senderfullnameSender of the file.
messagetorecipientsMessage of the sender.
sendermailaddressAlways empty for this notification.
url, download_url, file_urlLinks to the file. Empty when the recipient is a direct access.
community, communitydescriptionName and description of the community (vars.filesAvailableCommunity and community files of vars.filesAvailable).
typenode (inbox) or community.
filePath, fileAbsolutePath, fileFullPathPath of the file.
fileSizeSize of the file.
uploadInstant, formattedUploadDateUpload date of the file.

File downloaded ​

FieldDescription
filenameName of the file.
recipientPerson who downloaded the file.
recipientfullnameName of the person who downloaded the file.
communityName of the community, if the file was sent to a community.
url, download_url, file_urlLinks to the file.
fileRecipientType, fileRecipientNameWhere the file had been sent.
fileAbsolutePath, fileFullPathPath of the file.
filePathAlways empty: this notification does not provide it.
downloadInstant, formattedDownloadDateDownload date of the file.

File deleted ​

FieldDescription
filenameName of the file or directory.
sendername, sendershortname, senderfullnameSender of the file.
sendermailaddressAlways empty for this notification.
recipientRecipient of the file.
reasonReason of the deletion.
fileRecipientType, fileRecipientNameWhere the file had been sent.
filePath, fileAbsolutePath, fileFullPathPath of the file or directory.
fileTypeFILE or FOLDER.
numberOfFilesNumber of files deleted.
deletionInstant, formattedDeletionDateDeletion date.
deletedByFull name of the person who deleted the file; an empty text when the file was deleted automatically.
genericReasontrue when reason only says that a community member or administrator deleted the file; false otherwise.

File will be deleted ​

FieldDescription
filenameName of the file.
expireNumber of days before the deletion.
reasonReason of the deletion.
fileRecipientType, fileRecipientNameWhere the file had been sent.
filePath, fileAbsolutePath, fileFullPathPath of the file.
expirationInstant, formattedExpirationDateDeletion date of the file.
lastActivityInstant, formattedLastActivityDateDate of the last access to the file.
lastActivityDate
Available in4.20.0 +
Deprecated. Same date in UTC.

Community deleted ​

FieldDescription
communityName of the community.
reasonReason of the deletion.
lastActivityInstant, formattedLastActivityDateLast activity date of the community.
lastActivityDate
Available in4.20.0 +
Deprecated. Same date in UTC.
numberOfFilesNumber of files deleted with the community.
deletionInstant, formattedDeletionDateDeletion date of the community.
deletedByName of the person who deleted the community; an empty text when the community was deleted automatically.
genericReasontrue when reason only says that deletedBy deleted the community; false otherwise.

Community will be deleted ​

FieldDescription
communityName of the community.
expireNumber of days before the deletion.
reasonReason of the deletion.
lastActivityDate
Available in4.20.0 +
Deprecated. Last activity date in UTC.
lastActivityInstant, formattedLastActivityDateLast activity date of the community.
expirationInstant, formattedExpirationDateDeletion date of the community.
numberOfFilesNumber of files in the community.

Invitation to a share space ​

FieldDescription
inviterFull name of the person who sent the invitation.
community, communitydescriptionName and description of the share space.
messagetorecipientsMessage of the inviter.
urlLogin link of the recipient.
passwordAlways empty: this notification does not provide it.

Direct access available ​

FieldDescription
directAccessCodeCode of the direct access token.
sendername, sendershortname, senderfullnamePerson who created the token.
sendermailaddressEmail address of the person who created the token.
messagetorecipientsMessage of the person who created the token.
communityName of the share space that the token opens, if any.

Account will be locked or deleted ​

FieldDescription
expireNumber of days before the account is locked or deleted.
reasonReason: ADOPTION, EXPIRATION or INACTIVITY (same values as cleanupReason).
expirationInstant, formattedExpirationDateDate on which the account will be locked or deleted.
lastActivityInstant, formattedLastActivityDateDate of the last session of the account.
lastActivityDate
Available in4.20.0 +
Deprecated. Same date in UTC.
adoptionInstant, formattedAdoptionDateAdoption date of the account.
accountEndInstant, formattedAccountEndDateEnd date of the account.

Pre-grouped lists ​

The template does not need to group, sort or truncate the elements itself: the server provides the lists already grouped and sorted as the base theme displays them.

New files: vars.filesAvailableListing ​

vars.filesAvailableListing gives the new files on three levels:

  • communities: one entry per community, sorted by name, with community (the name), total (the number of files) and senders;
  • inbox: the senders of the files sent directly to the recipient's inbox, and inboxTotal, the number of these files;
  • a sender has name, total and uploads (its uploads, from the most recent to the oldest);
  • an upload has message (the message of the sender, empty if there is none) and files. Each file has file (the file, with filename, uploadInstant, fileSize, url…) and path (its directory, / at the root). The files at the root come first, then those of each directory, sorted by name.

upload.head(n) gives the first n files of an upload (items) and the number of files left out (remaining).

@foreach{community : vars.filesAvailableListing.communities}
  <h3>@{community.community} (@{community.total})</h3>
  @foreach{sender : community.senders}
    @foreach{upload : sender.uploads}
      @code{shown = upload.head(3);}
      @foreach{entry : shown.items}@{entry.path}@{entry.file.filename}<br/>@end{}
      @if{shown.remaining > 0}and @{shown.remaining} more<br/>@end{}
    @end{}
  @end{}
@end{}

Files by destination ​

vars.filesWillBeDeletedGroups, vars.receptionsAcknowledgedGroups and vars.filesDeletedGroups group the files according to where they had been sent: the communities first, then the recipient's inbox, the other users and the email addresses, each sorted by name.

  • A group has type (community, inbox, user or anonymous), name and items.
  • Each element of items has item (the file) and path (its path in the community or the inbox).

The lists tool ​

Available in4.21.0 +

The lists tool is available in all email templates, like dateFormatter. It is mainly used in the consolidated email:

  • lists.groupBy(list, key): the groups of elements that share a key, in the order of their first element. Each group has key, items and head(n).
  • lists.sortBy(list, key) and lists.sortByDescending(list, key): the list sorted by the key, in ascending or descending order (most recent dates first). Texts are compared without regard to case, elements without a key come last, and elements with the same key keep their order.
  • lists.head(list, n): the first n elements (items) and the number of elements left out (remaining).

These tools accept lists and sets (vars.filesAvailable is a sorted set). The key can be written in two ways:

  • an MVEL expression in quotes, evaluated on each element: 'senderfullname', or "community == null ? 'Inbox' : community";
  • an MVEL function of the element: def (file) { file.senderfullname }. A function only sees its parameter, not the other template variables. In a template, it does not accept the ? : operator: use if and return, or an expression.

Examples ​

<!-- The 5 most recent files, and how many others -->
@code{recents = lists.head(lists.sortByDescending(vars.filesAvailable, 'uploadInstant'), 5);}
@foreach{file : recents.items}
  @{file.fileFullPath} — @{file.formattedUploadDate}<br/>
@end{}
@if{recents.remaining > 0}and @{recents.remaining} more files@end{}

<!-- New files grouped by sender instead of by community, 3 files per sender -->
@foreach{group : lists.groupBy(lists.sortBy(vars.filesAvailable, 'senderfullname'), 'senderfullname')}
  <h3>@{group.key} (@{group.items.size()})</h3>
  @code{shown = group.head(3);}
  @foreach{file : shown.items}@{file.fileFullPath}<br/>@end{}
  @if{shown.remaining > 0}and @{shown.remaining} more@end{}
@end{}

<!-- A key computed by an expression -->
@foreach{group : lists.groupBy(vars.filesAvailable, "community == null ? 'Inbox' : community")}
  @{group.key}: @{group.items.size()} files<br/>
@end{}

<!-- A key computed by a function -->
@foreach{group : lists.groupBy(vars.filesDeleted, def (file) { if (file.fileType == 'FOLDER') { return 'Directories'; } return 'Files'; })}
  @{group.key}: @{group.items.size()}<br/>
@end{}

<!-- Communities that will soon be deleted, the closest to deletion first -->
@foreach{item : lists.sortBy(vars.communitiesWillBeDeleted, 'expirationInstant')}
  @{item.community}: @{item.formattedExpirationDate}<br/>
@end{}