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.txtin the Configure UI.
The layout, format and content can be modified.
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, example: $SUITEPATH
- The SUITEINFO column contains a bunch of information as key value pairs. This information can be viewed under
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.
email_template.txtlike the following:
Subject : $STATUS - $SUITEINFO_SUITENAME - $SUITEINFO_HOST - $SUITEINFO_PORT
If subject is provided in
mail.subject.prefixproperty will not be prefixed for the mail. If subject is not provided in
email_template.txtthen default subject will be set in the mail.
To provide subject in
email_template.xslhas been introduced from Sahi Pro 7.5.0.
email_template.txthas been removed from the Configuration.
To provide subject in
email_template.xsl, add the below mentioned code at line number 2 in
<!-- Subject : $STATUS - $SUITEINFO_SUITENAME - $SUITEINFO_HOST - $SUITEINFO_PORT -->