Hooks for booking emails

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:

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.

1 Like

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

​I hope this is helpful to you.

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

Not Working:

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:

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

function sk_listing_approved_sms( $listing ) { ... }

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

​I hope this is helpful to you.

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 thank you in advance

Replied via email.

I managed to write custom code via hooks. Thanks.

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