-
Notifications
You must be signed in to change notification settings - Fork 90
Email configuration
To receive email notifications, you need to fill in the part of the configuration file referring to sending emails
Configuration template for email notifications:
"mail":
{
"host": "...",
"port": "...",
"username": "...",
"password": "...",
"securityProtocol": "...",
"from": "...",
"recipient": "..."
}
Next, we will consider setting up email notifications using the Gmail service as an example:
-
"host" - The SMTP server to connect to (For Gmail it is "smtp.gmail.com")
-
"port" - The SMTP server port to connect to (Use 465)
-
"username" - User to authenticate to the SMTP server (Use Gmail name)
-
"password" - User's password for authentication. To generate a password, you need:
- Go to https://myaccount.google.com/security
- Choose "App Passwords"

- In the "Select app" field, select "Mail"
- In the "Select device" field, select "Windows computer"
- Click the "Generate" button

- Add the generated password to the "password" field of the configuration file

-
"securityProtocol": (optional: can be omitted or set to null) - one of the following security protocols:
- SSL - use SSL to connect (make sure the SSL port is used)
- STARTTLS - use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. If the server does not support STARTTLS, the connection continues without the use of TLS
-
"from" - Sender's email (Use Gmail name)
-
"recipient" - Recipient email (In the "recipient" field, you can specify a list of email addresses - [email protected], [email protected], [email protected] ...)
The final configuration will look like this:
"mail":
{
"host": "smtp.gmail.com",
"port": "465",
"username": "[email protected]",
"password": "abcqwertyabc",
"securityProtocol": "SSL",
"from": "[email protected]",
"recipient": "[email protected], [email protected], [email protected]"
}
- Download latest release https://github.com/qa-guru/allure-notifications/releases
or build .jar
gradle jar
->build/libs/allure-notifications-*.jar
- Put allure-notifications-*.jar in your in your autotests project root
- Install Post build plugin https://plugins.jenkins.io/postbuild-task
- Run .jar in postbuild task, after allure-report is generated (!!!)

java \
"-Dmessenger=email" \
"-Dmail.host=smtp.gmail.com" \
"-Dmail.port=465" \
"[email protected]" \
"-Dmail.password=12345..." \
"[email protected], [email protected]" \
"-Dproject.name=${JOB_BASE_NAME}" \ <- jenkins environment var
"-Dbuild.launch.name=Some release 2.0" \
"-Dbuild.env=https://prod.your.site" \
"-Dbuild.report.link=${BUILD_URL}" \ <- jenkins environment var
"-Dlang=en" \
"-Denable.chart=true" \
"-Dallure.report.folder=./allure-report/" \
-jar allure-notifications-2.2.1.jar
