# Pending-approval hooks

**URL:** <https://community.codefresh.io/t/pending-approval-hooks/689>\
**Category:** Pipeline Workflows\
**Created:** [December 7, 2021, 5:12pm UTC](https://community.codefresh.io/t/pending-approval-hooks/689 "2021-12-07T17:12:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Berry](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/simon_berry/32/440_2.png) [@Simon\_Berry](https://community.codefresh.io/u/Simon_Berry)\
**Post date:** [December 7, 2021, 5:12pm UTC](https://community.codefresh.io/t/pending-approval-hooks/689/1 "2021-12-07T17:12:06Z")

</div>

I want to send notifications to slack for all my steps.  
For the pending-approval type I want to send a message that indicates approval or denial but

If I run the pipeline below and approve or deny then none of the hooks are executed, can you shed any light on this please?

````auto

hooks: 
  on_elected:
    exec:
      image: zedplanet/slackmessenger
      commands:
        - echo on_success
        - ls
        - env
  on_success:
    exec:
      image: zedplanet/slackmessenger
      commands:
        - echo on_success
        - ls
        - env
  on_fail:
    exec:
      image: zedplanet/slackmessenger
      commands:
        - echo on_fail
        - ls
        - env
        
stages:
  - "deploy_uat"

steps:
  approval_to_deploy_uat:
    title: "Approval"
    type: pending-approval
    stage: "deploy_uat"
    timeout:
      duration: 24
      finalState: denied
    when:
      branch:
        only: [main]  
    hooks:
      on_elected:
        exec:
          image: zedplanet/slackmessenger
          commands:
            - echo on_elected
            - env
      on_finish:
        exec:
          image: zedplanet/slackmessenger
          commands:
            - echo on_finish
            - env
      on_success:
        exec:
          image: zedplanet/slackmessenger
          commands:
            - echo on_success
            - env
      on_fail:
        exec:
          image: zedplanet/slackmessenger
          commands:
            - echo on_fail
            - env```
````

---

<div class="post-metadata">

**Author:** ![Kostis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kostis/32/391_2.png) [@Kostis](https://community.codefresh.io/u/Kostis)\
**Post date:** [December 8, 2021, 10:06am UTC](https://community.codefresh.io/t/pending-approval-hooks/689/2 "2021-12-08T10:06:00Z")

</div>

Hello and welcome to the Codefresh community.

Your pipeline looks correct to me at first glance.

Please open a ticket with our support and be sure to include the URL of the build that doesn’t run hooks. It should be something like this [Codefresh | console](https://g.codefresh.io/build/61b082247efb287)

---

<div class="post-metadata">

**Author:** ![Simon\_Berry](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/simon_berry/32/440_2.png) [@Simon\_Berry](https://community.codefresh.io/u/Simon_Berry)\
**Post date:** [December 9, 2021, 10:36am UTC](https://community.codefresh.io/t/pending-approval-hooks/689/3 "2021-12-09T10:36:31Z")

</div>

Thanks

> Your request ([#10815](https://support.codefresh.io/hc/requests/10815)) has been received and we’ll get back to you as soon as possible.
