SmartAttach Customization
When using SmartAttach, an English text pre-defined in the server code with a link to the appropriate file is added to the email body (its header or footer respectively). Pre-defined text can be of either HTML or plain text formats.
SmartAttach supports a full range of customization/localization options:
- Global configuration file used to override the default template (smartattach.dat)
- Header/footer definition files for both HTML and plain text formats (files of arbitrary names located in arbitrary paths, referenced in smartattach.dat)
- Attachment variables that are replaced by actual values when the email is sent (e.g. %url%)
- SmartAttach templates that perpetually populate the header/footer with each attachment
- Constants that define the syntax of templates
- The default global template can be overridden via [Installation Directory]/config/smartattach.dat file, for example if you wish the download links to appear at the beginning of the email.
See also examples/smartattach.dat
- The first line contains headerfile;htmlheaderfile and the second one footerfile;htmlfooterfile strings with path references to the custom header/footer file names.
Note: These header/footer texts will be applied both to SmartAttach Content Filter and SmartAttach in IceWarp WebClient.
Note: The SmartAttach template syntax have to be used in all of these four files. If using custom header/footer, always define both HTML and plain text format, otherwise formatting issues can occur.
ALSO, use all supported variables (see lower) in your customized files, otherwise headers (footers respectively) will not be shownSee examples:
examples/smartattachtextheader.dat
examples/smartattachtextfooter.dat
examples/smartattachhtmlfooter.html
examples/smartattachhtmlheader.html
- Supported variables are:
%url%, attachment download link
%file%, attachment file name
%index%, numbered order of the attachment
%count%, total number of attachments
%expire%, number of days after which the attachment download link expires
%size%, attachment size
%expiredate%, date of the attachment link expiration
- When creating a custom template, do not forget to enclose the attachment part into <smartattach:template></smartattach:template> tags. The content between these tags will be repeated as many times as many attachments the email has.
- There are also special tags, which enclose part of the template that will be included only if the attachment expires after some days. In other words, emails with smart attachments sent through through Content Filters where Expiration is set to 0 (never expires) will not have this part.
<smartattach:expire>
</smartattach:expire>
To Customize SmartAttach Headers/Footers:
- Define your own header/footer files, for simplicity leave them in [Installation Root]/config but they can be anywhere, of any name.
- The easiest way is to copy over the files in /examples/smartattach*, and localize the strings they contain with the exception of <tags> and %variables%.
Note: Do not forget to remove all commented lines from the example files!
- You can make any other adjustments such as swapping the contents of header and footer if you wish the links to appear at the end of email rather than on its beginning (the default).
- If necessary, create or edit the [Installation root]\config\smartattach.dat file so that it refers to the previously created header/footer files.
This is sufficient for WebClient SmartAttach localization.
To create an individual header/footer for a domain, create a custom SmartAttach Content filter and select the new header/footer file using the Header/Footer dialog while setting up the filter. For more details, refer to the On-server Setup section of the GroupWare Sharing Concepts SmartAttach chapter.
Note: Individual (such as per domain) header/footers will not work in IceWarp WebClient. WebClient will use only the global setting configured by smartattach.dat. If the header/footer does not contain the mandatory template tags, then the default one is appended.