Notifications are updates about your activity on Bitrise. Usually, they concern the state of your builds but you can receive notifications about a lot of different things.
Email notifications ⚓
Our built-in email notification system sends emails about builds to every user who is assigned to work on an application. They are sent when a build is finished.
Email notifications are automatically set up for all applications when first creating them. By default, there are different settings for successful builds and failed builds.
There are three possible settings:
- Always send email. This is the default setting for failed builds.
- Never send email.
- Send email when build status changes on the same branch. This is the default setting for successful builds. This means that if build #1 and build #2 both succeeded, you will not get a notification about build #2. However, if build #3 fails and then build #4 succeeds again, you will be notified.
The alternative solution is to send emails via a dedicated Step: this allows for far more customization regarding the notifications. We’ll cover both options in this guide.
Watching an app ⚓
Watching an app means getting email notifications for that app. This is the default setting for every app you create or you are invited to. Turning off watching the app means you will NO LONGER GET AUTOMATIC NOTIFICATIONS.
To toggle the feature, go to your Dashboard and open the app you want to watch or unwatch. On the top right, you will see a button with the label Watching if you are watching the app currently. If not, the button will show Watch. Toggle it.
Configuring email notifications ⚓
You can change your email notification settings at any time - you can even completely disable them.
- Open your Dashboard.
- Select the app you want to configure.
- Go to the Settings tab.
-
Scroll down to email notifications.
-
Select the settings you need for both successful and failed builds from the appropriate dropdown menu.
For example, if you want to disable receiving notifications, set both options to Never send email.
Sending emails with a Step ⚓
The Send Email with Mailgun Step can send emails to any email address with customized updates, in either HTML or plain text format. You can use environment variables to send information, as well as attach files to the emails.
To use the Step, you need:
- A Mailgun account.
- A Mailgun API key.
- Your Mailgun domain name.
-
Create a Secret Environment Variable that holds your Mailgun API key.
We recommend naming the key
$MAILGUN_API_KEY
. This is the default value of the Step’s relevant input. -
Create a Secret Environment Variable that holds your Mailgun domain.
We recommend naming the key
$MAILGUN_DOMAIN
. This is the default value of the Step’s relevant input. - Add the Send Email with Mailgun Step to the end of your workflow.
- Find the Send To emails input of the Step. Click on the input and then click Select secret variable.
-
Create a new Secret Environment Variable that contains the list of the email addresses.
You can choose any key you want. The addresses should be separated by a comma.
- Set the email subject, and the two potential email messages: one for a successful build, one for a failed build.
- You can insert environment variables to any of the inputs (the subject and the messages). In the email, the values of the variables will be displayed.
- The default messages will send the name of the app, the number of the build and whether the build succeeded or failed.
-
Attach files, if necessary: the File attachments input accepts a file path or an environment variable as input.
Multiple files can be attached: separate their paths with commas.
Run a build - and check your emails!
Integrating with Slack ⚓
Bitrise supports Slack integration, of course - and it’s quite easy to set it up. Send Slack messages to individual users, groups or channels; customize the messages, include attachments, and link buttons that will take the users to the build page.
To use our dedicated Step, you need either a Slack webhook URL or a Slack API token for a Slack bot user.
- Add the Send a Slack message Step to your Workflow.
-
Find either the Slack Webhook URL or the Slack API token input. Click on the input and then click Select secret variable.
-
Create a new Secret Environment Variable that stores your webhook URL or your Slack API token.
You can choose any key you want.
-
Customize your Slack message with the relevant inputs of the Step.
There are several options, including but not limited to:
- Setting the target channel, group or username: this can be a name or an encoded ID.
- The text of the message to send.
- The bot’s username for the message
- The message’s color
- File attachment
- Link buttons attached to the message
Check out all the inputs in the Workflow Editor to see all the ways in which you can customize your Slack messages.
Once you’re done, run a build!