Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

email notifications


can anyone please tell me how to configure the email notifications for every build success/failure. Need to send multiple recipients who is not having the slack subscription.

Few examples already available, but need a step by step implementation to add in the existing repo.


Thanks in advance.  

3 answers

1 accepted

0 votes
Answer accepted

Hi @Sarath ,

thank you for your question!

It's a good case to use email-notify pipe.

Please, follow next steps to setup it:

Step 1: Configure your Bitbucket repository for the project 

Add your credentials and configuration settings in Bitbucket as variables (see: how to configure Pipelines variables).

Settings > Pipelines > Repository variables:

PASSWORD: The password to authenticate with

Step 2: Setup your CI/CD configuration

Edit and add these steps to bitbucket-pipelines.yml :

image: atlassian/default-image:2

test: &test
name: Test
- echo "Everything is awesome!"

build: &build
name: Build
- echo "Starting build..."
#- <your build logic>
- ALERT_TYPE="success"
- if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then ALERT_TYPE="error" ; fi
- pipe: atlassian/email-notify:0.3.12
FROM: ''
TO: ','
HOST: ''
SUBJECT: '${ALERT_TYPE}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH}'

- <<: *test
- <<: *build
- <<: *test
- <<: *build

Step3: Check your Pipelines status and messages in your email account )



Note: We recommend using the pipe with your own email server or third-party providers that support massive email notifications (Sendgrid, AWS SES, ...). Some free accounts from vendors such as Gmail or Outlook have special policies about security and rate limiting that could affect configuring and using the pipe. Make sure you read about it and understand their policies before using them.

Hi Oleksandr Kyrdan,

Thanks for reply, I have used gmail smtp server details along with the code you mentioned above. I got the below error.

✖ Failed to send email. Check your configuration settings.

I have enabled the required settings in my gmail security settings. 

@Sarath ,

make sure that you've turned on Lesssecure access for your account (periodically Google can turn it off) .

Also, check if no messages in your account about blocked access.

@Oleksandr Kyrdan ,

I have enabled the  Lesssecure access earlier itself. But it is blocking me as you mentioned. So I did use two step verification and created a app password. Its working and I got the email notifications. thanks for the help.

Hi Oleksandr Kyrdan,

 I have achieved the sending email notification from pipeline. But I need to get the commit id of the build and who committed the code, tests case failures if any and a sonar cloud quality checks. Together I need to get evetything about the build failure/success as a report in a single email. Is it possible. if yes please mention the sample  script please.

Like Abryan Manalansang likes this

I having same issue as well.

When using Sendgrid, it is important to remember that the username is `apikey` and the password is the API key. The Sendgrid tutorial uses base64 encoded values for username and password, but the Atlassian pipeline specifically uses PLAIN authentication, so it is an error to encode the username and password variables.

Hi @Oleksandr Kyrdan , @Abryan Manalansang , @Sarath 

I have enabled the  Lesssecure access . But still it is blocking me.

if u have steps please send me 

thanks in advance


After enabling the  Lesssecure access , on the same security page, you need to turn on 2-step verification and then create a App password which will be provided by google. You have to use this generated app password in your repo. Then you will be able to send the emails.

Like # people like this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

185 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you