Advertisement
eventsmanager

Send email per booking status

Feb 7th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * How to use this snippet
  5. * - using your host cpanel or ftp, go to wp-content > (create this folder) mu-plugins > (create this php file) functions.php
  6. * - edit file functions.php
  7. * - paste the snippet below
  8. *
  9. * Booking Status:
  10. * 0 = Pending
  11. * 1 = Approved
  12. * 2 = Rejected
  13. * 3 = Cancelled
  14. * 4 = Awaiting Online Payment
  15. * 5 = Awaiting Payment
  16. */
  17.  
  18. function my_em_custom_email($result, $EM_Booking){
  19. if ( $EM_Booking->booking_status == 1 ){
  20.  
  21. foreach($emails as $key => $value) {
  22. $EM_Booking->email_send(
  23. $EM_Booking->output(get_option('dbem_bookings_email_confirmed_subject')),
  24. $EM_Booking->output(get_option('dbem_bookings_email_confirmed_body')),
  25. $value
  26. );
  27. }
  28.  
  29. }
  30. return $result;
  31. }
  32. add_filter('em_booking_set_status','my_em_custom_email',100,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement