Email Properties and Templates
abstract This section describes sending status emails during suite execution.
infoFor details about sending emails via a Sahi script, refer Sending Emails.
|mail.smtp.starttls.enable||boolean||If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the server's certificate.|
|mail.host||String||The server to connect to.|
|mail.port||int||The server port to connect to.|
|mail.user||String||Default user name.|
|mail.password||String||Password. This is ignored if encrypted password is provided.|
|mail.encrypted.password||String||Encrypted password. Salt for encryption is as per properties. If encrypted password is provided, mail.password is ignored.|
|mail.smtp.auth||boolean||If true, attempt to authenticate the user using the AUTH command.|
|mail.isSSL||boolean||If true, uses SSL to connect and use the SSL port by default.|
|mail.from||String||Email address of the sender|
|mail.to||String||Email address of the sender's To field. For multiple address separate by comma(,).|
|mail.cc||String||Email address of the sender's CC field, for multiple address separate by comma(,).|
|mail.bcc||String||Email address of the sender's BCC field. for multiple address separate by comma(,).|
|mail.subject.prefix||String||The subject prefix for the email.|
mail.smtp.starttls.enable=true mail.host=smtp.gmail.com mail.port=25 email@example.com mail.password=your_password #mail.encrypted.password=your_encrypted_password mail.smtp.auth=true mail.isSSL=false firstname.lastname@example.org email@example.com,firstname.lastname@example.org,email@example.com firstname.lastname@example.org,email@example.com firstname.lastname@example.org,email@example.com mail.subject.prefix=my subject
email_template.xslis present in the
The layout, format and content of this template can be modified. To add modifications, copy the email template file
<Sahi_Installation>/userdata/configdirectory. Now make changes as necessary to this copied file.
With regard to content, the following information can be added.
- Value of any column in SUITEREPORTS table that is not already present in the template can be added using $COLUMNNAME, for example: $SUITEPATH
- The SUITEINFO column contains a bunch of information as key-value pairs. This information can be viewed under the
Suite Infosection in the Suite Report log. A value can be added using $SUITEINFO_KEY. For example, the BaseUrl can be added using $SUITEINFO_BASEURL. If custom fields were specified for the suite, they will be available in SUITEINFO so they can be added to the email template as well. For example, if a custom field "RELEASEID" was specified while running the suite, its value can be added in the email template using $SUITEINFO_RELEASEID
warning The variable names are to be specified in UPPER case.
<!-- Subject : $STATUS - $SUITEINFO_SUITENAME - $SUITEINFO_HOST - $SUITEINFO_PORT -->
If a subject is provided in
mail.subject.prefixproperty will not be prefixed for the mail. If a subject is not provided in
email_template.xslthen the default subject will be set in the mail.
warning Email template file
email_template.xslis available since Sahi Pro v7.5.0. For versions prior to Sahi Pro v7.5.0, use
email_template.txt. Refer here for details.