# Hooks for booking emails

**URL:** <https://community.hivepress.io/t/hooks-for-booking-emails/9491>\
**Category:** Bookings\
**Tags:** code\
**Created:** [January 31, 2024, 4:46pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491 "2024-01-31T16:46:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![saagark22](https://community.hivepress.io/user_avatar/community.hivepress.io/saagark22/32/3256_2.png) [@saagark22](https://community.hivepress.io/u/saagark22)\
**Post date:** [January 31, 2024, 4:46pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/1 "2024-01-31T16:46:14Z")

</div>

I have HivePress Booking plugin setup which sends below emails

1. Booking Confirmation
2. Booking Request
3. Booking Declined
4. Booking Cancelled (User)
5. Booking Cancelled (Guide)
6. Booking Accepted (User)
7. User Registration
8. Membership Approved
9. Message Received
10. Guided Outdoors Booking Reminder

When these emails are sent, I also want to send SMS to user and guide/vendor.

I have already coded for SMS with relatant APIs and SMS are sending from the website successfully.

I just want to know relatant hooks for above emails, so when those emails are triggered SMSs are send as well.

**For Example:**

```auto
add_action( 'hivepress/v1/emails/listing_reject/send', 'sk_listing_reject_sms', 10, 1 );

function sk_listing_reject_sms( $listing ) {
.
.
.
sendSMS($to, $subject);// This function for SMS is already coded.
}

```

I need help with only hooks.

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [February 1, 2024, 2:07pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/4 "2024-02-01T14:07:32Z")

</div>

Hi,

If you are referring to email hooks, I recommend checking them out in WP Dashboard \> Plugins \> Plugin File Editor HivePress Bookings \> includes \> emails. For example, there is a `class-booking-accept.php`, then its hook will be `/booking_accept/send.` [Action: hivepress/v1/emails/{email\_name}/send | HivePress Hook Reference](https://hivepress.github.io/hook-reference/hivepress_v1_emails_%257Bemail_name%257D_send.html)

​I hope this is helpful to you.

---

<div class="post-metadata">

**Author:** ![saagark22](https://community.hivepress.io/user_avatar/community.hivepress.io/saagark22/32/3256_2.png) [@saagark22](https://community.hivepress.io/u/saagark22)\
**Post date:** [February 2, 2024, 8:36am UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/5 "2024-02-02T08:36:53Z")

</div>

I have already tried, hooks from HivePress Booking are not working

Not Working:

```auto
add_action( 'hivepress/v1/emails/booking_accept/send', 'sk_booking_acceptd_sms');

function sk_booking_acceptd_sms( $listing ) { ... }

```

Where is in similar fashion HivePress Hooks are working

Working:

```auto
add_action( 'hivepress/v1/emails/listing_approve/send', 'sk_listing_approved_sms');

function sk_listing_approved_sms( $listing ) { ... }

```

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [February 6, 2024, 9:40am UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/8 "2024-02-06T09:40:38Z")

</div>

Hi,

The hooks you are using look good, I recommend debugging this using `error_log,` and make sure you are triggering these emails accurately (you can use a tool on Local WP that displays such messages). Also, I recommend checking the hook references, because you need to use an email object or another argument to the send hook [HivePress Code Reference](https://hivepress.github.io/code-reference/namespaces/hivepress-emails.html)

​I hope this is helpful to you.

---

<div class="post-metadata">

**Author:** ![muslimbnb](https://community.hivepress.io/user_avatar/community.hivepress.io/muslimbnb/32/3235_2.png) [@muslimbnb](https://community.hivepress.io/u/muslimbnb)\
**Post date:** [February 6, 2024, 12:55pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/9 "2024-02-06T12:55:39Z")

</div>

Hi saagark22 I read your message about automatic notifications, I also need to code to send sms with email notifications. Can you help me: your code would help me a lot: my email: [contact@muslimbnb.fr](mailto:contact@muslimbnb.fr) thank you in advance

---

<div class="post-metadata">

**Author:** ![saagark22](https://community.hivepress.io/user_avatar/community.hivepress.io/saagark22/32/3256_2.png) [@saagark22](https://community.hivepress.io/u/saagark22)\
**Post date:** [February 17, 2024, 11:06am UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/10 "2024-02-17T11:06:55Z")

</div>

Replied via email.

---

<div class="post-metadata">

**Author:** ![saagark22](https://community.hivepress.io/user_avatar/community.hivepress.io/saagark22/32/3256_2.png) [@saagark22](https://community.hivepress.io/u/saagark22)\
**Post date:** [February 17, 2024, 12:11pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/11 "2024-02-17T12:11:59Z")

</div>

I managed to write custom code via hooks. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [March 18, 2024, 12:12pm UTC](https://community.hivepress.io/t/hooks-for-booking-emails/9491/12 "2024-03-18T12:12:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
