E-Mail Templates
New template variables in files
folder_invitation.vm
invitation_response.vm
Sender of the invitation:
$senderName - the display name (First + Surname) of the sender (or username if not set)
$senderUsername - the username of sender
$senderAccount - the sender account object. More fields can be accessed by (dot) notation, e.g. $senderAccount.ldapDN, $senderAccount.language
See more at https://github.com/powerfolder/PF-CORE/blob/master_14/src/main/de/dal33t/powerfolder/security/Account.java
Recipient of the invitation:
$recipientName - the display name (First + Surname) of the recipient (or username if not set)
$recipientUsername - the username of recipient
$recipientAccount - the recipient account object. More fields can be accessed by (dot) notation, e.g. $recipientAccount.ldapDN, $recipientAccount.language
See more at https://github.com/powerfolder/PF-CORE/blob/master_14/src/main/de/dal33t/powerfolder/security/Account.java
The Email templates can be found in the Server Maintenance Folder which is available for the Server Admin in the folder list. Each Email consists of a subject translation key (like mail.subject.add_email_address in #Translator.properties) and a Content.vm. The template files can be edited with any HTML Editor and HTML and CSS can be used as you wish and the translation files are basically just plain text.
Keep in mind that Email-clients behave differently than web browsers and require a special structure. Therefore it might be the best solution to edit the existing templates rather than creating new ones from scratch.
The subject templates have been replaced with translation keys in 11.4 SP 4. Please make sure to copy any changes of the default subject files to the translation keys.
VM Parameters start with a '$'
(Dollar sign) and will render the content of that parameter before sending the Email.
Example: $targetName
will render the Email address of a newly invited user or the Name of an exiting user.
Also VM parameters can be used with #IF #ELSE #END to render the Emails depending on conditions.
Example: #if ($account.language == "de") Content DE #else Content EN #end
This will render the content for a specific language. More information on Apache Velocity template engine.
This table shows the variables to be used in E-Mail templates and what they are.
When using those variables, they all need a prefix '$'
(Dollar sign). For some more "safety" it is advised to use another '!'
(exclamation mark) after the dollar sign.
The exclamation mark prevent "uninitialized" variables (those, that don't even contain an empty string) to produce a string containing "null" instead of just an empty string.
If "message" was initialized with "Hello, World!", the use of "Test: $message" in a template would result in
"Test: Hello, World!"
If "message" was initialized with null
instead of a String, "Test: $message" would result int
"Test: null
"
But if "message" was initialized with null
"Test: $!message" would show
"Test: "
Variable name | Example | Description | Template |
---|---|---|---|
Dropped with v11.4 SP4
|
| The language of the inviting account. Replaced by |
|
loginURL | https://example.com/login | The URL of the service to login. | folder_invitation.vm |
folderURL |
| The URL to the folder. If the feature "Enable accepting new folder shares" is enabled, the folderURL only contains the base URL to all folders of the target account. | folder_invitation.vm |
senderAccount | The Account Object (see the source code for all methods) of the sender. | folder_invitation.vm | |
senderUsername | mustermann@powerfolder.com | The sender account's username or email. |
|
senderName |
| The sender account's display name. Uses full name if available, otherwise shows username or email. |
|
recipientUsername | musterfrau@powerfolder.com | The target account's username or email. |
|
| The Account Object (see the source code for all methods) of the recipient. With this object, it is possible to call all methods, the Account class provides. For Example would a $ result in the display name of this account. | folder_invitation.vm | |
|
| The recipient account's display name. Uses full name if available, otherwise shows username or email. |
|
newAccount |
| Whether the target account was newly created via invitation. | folder_invitation.vm |
password |
| For For |
|
folder |
| Contains the localized name of the folder (legacy). | folder_invitation.vm |
folderName |
| Contains the localized name of the folder. |
|
folderOnline |
| If the Folder is currently mounted/exists on the server sending the E-Mail. | folder_invitation.vm |
folders | A List of Folder Objects. | report_folder.vm | |
|
| A text the inviting user entered, and the invited user will be shown. |
|
account | The Account Object (see the source code for all methods) of the user who wants to reset his/her password or just registered. |
| |
account.organizationOID |
| The ID of the organization the account is belonging to |
|
resetURL | https://example.com/changepassword | The URL to the page to change the password. In the registration.vm e-mail it is only displayed, if the account the mail is sent to is authenticated by the database. |
|
downloadURL | https://example.com/dl/<FileLinkID>/<FileName> | The URL to download the linked file. | file_link_invitation.vm |
filename | presentation.pdf | The file name of the file to be shared. | file_link_invitation.vm |
fileName | abschluss.doc | The file name of the file that is in conflict. | notify_on_file_conflict.vm |
username | ksdfj98234 | The username of the registered user. |
|
name | Erika Musterfrau | The display name of the registered user. | registration.vm |
daysLeft |
| Days until the account will be disabled. Where 0 is a disabled account, and -1 means that the account never expires. | registration.vm |
daysOffline |
| Days since last login. -1 stands for an account that never logged in. | alert_account_offline.vm |
email | username@example.com | The E-Mail address to be added to an account. |
|
mergingAccount | gz9238 | The username of the account that initiated adding the E-Mail address to his/her account. |
|
verify_link | https://example.com/myaccount?action=verifyEmail&token=<token> | The link the user has to click to confirm that the E-Mail address should be added to his/her account. |
|
products | In case of In case of |
| |
problems | 3 | Number of Problems. | report_folder.vm |
downloadLink | https://example.com/dl/<FileLinkID>/<FileName> | A Link to download the file in conflict. | notify_on_file_conflict.vm |
isToAgreeOnMembership |
| If the user has to agree to an invitation. | folder_invitation.vm |
isOwnerInvitation |
| If it is an invitation for ownership to a folder. | folder_invitation.vm |
folderstableURL | https://pf.example.com/folderstable | The link to the folderstable | folder_invitation.vm |
invitorUsername | mustermann@powerfolder.com | Salutation line with username for an accepted invitation response email. | invitation_response.vm |