OS4X plugin os4xplugin email files
Purpose
Send all files as attachement of a job to a defined recipient via email. The mail body text content is freely configurable.
Requirements
- OS4X Enterprise license
- configured and working MTA
Configuration
- Alternative mail FROM address: override the default value of "OS4X <os4x>".
- Email address CC: a list of freely defined CC recipient(s) is configurable. This configuration option supports XPath expressions based on the job's XML.
- Email address CCC: a list of freely defined CCC recipient(s) is configurable. This configuration option supports XPath expressions based on the job's XML.
- Alternative mail subject: The subject of the sent email. This configuration option supports XPath expressions based on the job's XML.
- Send subject UTF-8 encoded: some MTAs need the subject formatted as UTF-8 for special characters.
- Absolute path to mail template: the path of the mail body text template, see below.
- Debug mail execution: when enabled, more information about environmental variables and the mail command itself is being logged.
- Send mail as HTML: if required, the sent mail will be declared as "Content-Type: text/html" instead of "Content-Type: multipart/mixed", which may be required for most mail clients to interpret the attachement correctly.
- MTA (sendmail) command: the MTA program for sending emails (default: sendmail). If "sendmail" is not available in the PATH (i.e. in "/usr/sbin/sendmail"), you can configure the used MTA here.
Mail templating
Mail subject
The configurative value can include XPath expressions, indicated by a single dollar sign ("$
").
A productive example could be:
OS4X Transfer-PDF - Auftrag $/OS4X_job/job_information/job_number (gesendet an Fa. $/OS4X_job/job_information/recipient/partner_longname)
Mail content
A configurable mail template must be configured. This text file is the body of the mail sent to the corresponding person. The default mail template is as follows:
Sehr geehrter OS4X-Nutzer, Ihr OS4X-Auftrag $/OS4X_job/job_information/job_number wurde erfolgreich transferiert. Anbei die zugehörigen Dateien. MfG OS4X
As you can see, a variable is contained in this template. You can use as many variables as you want, the plugin will replace them with the content of the variables. All variables are indicated by a dollar sign "$
" (as in shell scripts). The end of the variable name is a whitespace, tab or end of text. The variable itself is an XPath expression, i.e.:
/OS4X_job/job_information/job_number
This XPath information is executed on the configured XML (either actual or initial one, see above).