Report mailer
Using the TSFReportMailer custom task, provided with the Software Factory, it is possible to export reports and/or send emails from the Software Factory.
It is produced by creating a GUI code task or report. The Object name must be entered with TSFReportMailer. Use can be made of the following table for creating parameters.
Parameters
An overview of the parameters that can be used:
Parameter | Default Value | Data type | Description |
---|---|---|---|
report_id | string | Name of the report | |
export_file_spec | string | Export file name (for example to be filled from a default) | |
export_file_extension | string | With this parameter, the file format can be selected of the report that will be generated. The parameter value is not case sensitive. Possible values: - rtf - csv - xml - xls - xls_data - xlsx_data - doc - word_rtf | |
overwrite_old | false | boolean | Overwrites the file if it already exists and if this parameter is set to true. |
send_mail | true | boolean | Tries to send an email if this parameter is set to true. |
open_in_outlook | false | boolean | Tries to open the email if this parameter is set to true. |
save_mail | false | boolean | Tries to save the email in the Drafts folder if this parameter is set to true. NOTE: If open_in_outlook is also set to true then this parameter will be ignored! |
html | false | boolean | This parameter converts the format of the email to HTML if it is set to true. |
priority | 1 | integer | This parameter indicates the urgency of the email. Possible values: 0 = low urgency 1 = normal urgency 2 = high urgency. |
e_mail | string | Email address to which the email has to be sent. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.) | |
cc | string | CC email address for the email. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.) | |
bcc | string | BCC email address for the email. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.) | |
reply_to | string | Reply-to email address for the email. (Multiple email addresses can be added here, which have to be separated by a semicolon.) | |
body | string | If HTML tags are used for the actual message of the email, then the html parameter has to be set to true. | |
subject | string | The subject of the email. | |
use_signature | false | boolean | If this parameter is set to true, the standard signature is used that is configured in Outlook. |
signature_text | string | Set this parameter if you want to use a different signature text. | |
signature_image | string | Set the parameter if you want to use an image in the signature of the email. | |
account | string | Set this parameter if the email should be sent from a different account than the default account that is installed on the PC. | |
sent_on_behalf_of_name | string | Set this parameter to send the report on behalf of a different email address. | |
delete_file | false | boolean | Set this parameter to true if the report, which is used as an attachment, should be deleted after sending the email. |
smtp_only | false | boolean | Set this parameter to true if you just want to email with SMTP and do not want to email with Outlook. |
smtp_username | string | User name of the SMTP. | |
smtp_password | string | Password of the SMTP. | |
smtp_host | string | Host address of the SMTP | |
smtp_port | 0 | integer | The port to which the SMTP server listens. If this is not set, port 465 will be used for SSL. Without SSL, port 25 will be used |
smtp_from_mail | string | Email address where the email comes from. | |
smtp_use_ssl | false | boolean | Set this parameter to true if the SMTP server expects an SSL connection. |
extra_attachments | string | This can be used to add extra attachments to the email. If more than one file is to be added, they have to be separated by means of a semicolon. For example: C:/file1.txt;C:/file2.txt | |
smtp_from_displayname | string | With this parameter, the display of the sender's name in an email can be modified. This parameter is optional. |
If no values are entered, these fields are considered to be empty text fields and will be treated as such in the GUI. Initially, all parameters are optional, however, some of them are linked to each other.
Reports
To generate a report in PDF format with the TSFReportMailer, the following parameters at least have to be entered.
Mandatory
- report_id
- export_file_spec
Optional
- overwrite_old
- export_file_extension (default pdf)
Email via Outlook
To send an email with Outlook via the TSFReportMailer, the following parameters at least have to be entered and the parameter send_mail should be set to true, which is the default value.
Settings
- send_mail = true
Mandatory
- e_mail
This is not mandatory if the parameter open_in_outlook is set to true, the default value of this is false.
Optional
- smtp_only
- send_mail
- open_in_outlook
- save_mail
- html
- priority
- e_mail
- cc
- bcc
- body
- subject
- use_signature
- signature_text
- signature_image
- account
- extra_attachments
Email via SMTP
The TSFReportMailer tries as much as possible to revert to SMTP as it would otherwise become too much for the server. If this requires an alternative configuration, the mandatory parameters at least should be entered, otherwise the SMTP parameters will be ignored.
Settings
- send_mail = true
- smtp_only = true
Required fields
- smtp_username
- smtp_password
- smtp_host
- smtp_from_mail
- e_mail
Optional fields
- smtp_port
- smtp_from_displayname
- smtp_use_ssl
It is also possible to specify (part of) the SMTP settings using parameters in the configuration file so that these are the same for all users.