MY ACCOUNT / MY ORGANIZATON
Troubleshooting
BEST PRACTICES

Custom Script Samples

Send email notification when a build is complete

You can send notification emails when your build is complete so that you or your teammates will know the build status.

Here's a sample Bash script to send emails from a custom script step:

Bash
Bash
#!/usr/bin/env bash
#
# Send an email when a build is completed in Appcircle.
#
# Email address for the receipent
RCP_ADDRESS="receipent@example.com"
CC_ADDRESS="cc_receipent@example.com"
# Subject line for email
EMAIL_SUBJECT="AppCenter Build"
# Send a corresponding email for successful builds.
echo "Build completed successfully, sending email notification."
echo -e "Your build in Appcircle is completed successfully." | mail -s "Build completed with success." ${RCP_ADDRESS} -c ${CC_ADDRESS}
echo "Email notification sent."

Send Slack notification when a build is complete

If you have a Slack webhook created, you can send a message to your Slack channel with a single line of Bash script.

You can refer to Slack's webhook documentation here: 🔗 Creating Slack webhooks

Bash
Bash
#!/usr/bin/env bash
#
# Send a Slack notification when a build is completed in Appcircle.
#
curl -X POST -H 'Content-type: application/json' --data '{"text":"Appcircle build is completed successfully!"}' SLACK_WEBHOOK_URL