Description
You can use Use the Mail job entry to send a text or HTML e-mail email with optional file attachments. This job entry is used at the end of a job run in most instances.
Note: Do not confuse this with the Mail transformation step, which is slightly different.
Options
...
Option
...
Description
...
Name of the job entry
...
It can be used to announce both a job failure or success. For example, it is not uncommon at the end of a successful load, to send an email to a distribution list announcing that the load was successful and include a log file. If there are errors, an email can be sent to alert individuals on a distribution list.
Important: No email messages are sent when a job crashes during a run. If you are bound by service level agreements or quality of service agreements you may not want to use this job entry as a notification method.
The Mail job entry requires an SMTP server. You can use authentication and security as part of the connection but you must have the SMTP credentials.
You can attach files to your email messages such as error logs and regular logs. In addition, logs can be zipped into a single archive for convenience.
Options
Addresses tab
OptionDescription| Job entry name | The unique name of the job entry on the canvas. A job entry can be placed
...
on the canvas
...
several times; however it will be the same job entry
...
|
Destination address Address | The destination for the e-Mai. You email; you can specify multiple addresses if you separate them with a space. |
Use authentication | Check this if your SMTP server requires you to authenticate yourself. |
Authentication user | The user name to authenticate with |
Authentication password | The password to authenticate with. |
SMTP server | The mail server to which the mail has to be sent. |
Reply address | The reply address for this e-Mail |
Subject | The subject of the e-Mail |
Include date in message | Check this if you want to include the date in the e-Mail
|
Cc: | An identical copy of the message is also sent to all the addresses listed in the Cc: field. To enter more than one address in the Cc: field, separate them with a space. |
BCc: | Send to a recipient whose email address does not appear in the message |
Sender name | Name of the person sending the email |
Sender address | Email address of the person sending the email |
Reply to | Email address of the person to which to send a reply |
Contact person | The name of the contact person to be placed in the e-Mail email |
Contact phone | The contact telephone number to be placed in the e-Mail the email |
Server tab
OptionDescription| SMTP Server | The SMTP server address |
Port | The port on which the SMTP Server is running |
Use Authentication | Enable to use authentication to the SMTP Server |
Authentication user | SMTP user account name |
Authentication password | SMTP user account password |
Use Secure Authentication? | Enable to use secure authentication |
Secure Connection Type | Select authentication type (SSL, TSL) |
Email Message tab
OptionDescription| Include date in message? | Enable to include date in message |
Only send comment in mail body? | Leave unchecked if you want details of the job's execution included in the mail (job name etc., job statistics [number of rows read/written/..., number of errors etc.], the job's log) |
Comment | Additional comment to be placed in the e-Mail |
Attach files to message | Check this if you want to attach files to this message. See the Tips below. |
Select the result files types to attach. | When a transformation (or job) processes files (text, excel, dbf, etc) an entry is being added to the list of files in the result of that transformation or job. Specify the types of result files you want to add. |
Zip files into a single archive | Check this if you want to zip all selected files into a single archive (recommended!) The zip filename Specify the name of the zip file that will be placed into the e-mail. Note: All text fields can be specified using (environment and Kettle) variables, possibly set in a previous transformation using the Set Variable step.If not enabled the email will contain information about the job and its execution in addition to the comment |
Use HTML in mail body | The message is sent in HTML format |
Encoding | Select encoding type |
Manage Priority | Enable to manage priority. Note: The support of this flag is depending on the mail server.
|
Subject | Enter the subject of the mail into this field. |
Comment | Enter the comment within the body of the mail into this field. |
Attached Files tab
OptionDescription| Attach files to message? | Enable to attach a file to your email message |
Select file type | The files to send are defined within the internal files result set. Every file in this list is marked with a file type and you can select what type of file you want to send (see also the tips at the end of this document):
|
Zip files to single archive? | Enable to have attachments achived in a zip file |
Name of the zip archive | Define the filename of your zip archive |
Filename | Name of a single image file to add. Note: This works only when Use HTML format is defined in the EMail Message tab. |
Content ID | Automatically entered |
Image | The full path to image (used when embedding multiple images) Click Edit to edit the path; click Delete to delete the path to the image |
Content ID | The image content ID (used when embedding multiple images) Click Edit to edit the content ID; click Delete to delete the Content ID |
Tips
How to attach a particular file to the e-mail
...
- When creating a file with a step that supports it, allow it to mark the file as a Result File.
For example the "Text file output" step has the check-box "Add filenames to result" on the File tab for that purpose. (I guess the The file type would will be General but aren't sure.) - Use the step "Set files in result" from the Job category to mark a file as a result file of a particular type. This steps expects the file name to be in a field (you can use e.g. "Generate Rows" in combination with "Add constants" to produce a row containing the file name).
See this forum message with an example attached.
Attaching transformation's log
...
- In the Transformation job entry's options, check "Specify logfile?" and enter a name and extension for the file. You can also specify the desired log level.
- In the Mail job entry's options, check "Attach files to message" and select (at least) the file type "Log".
- Voila! The next time the mail is send, it will have the transformation's log attached.