Send Fields to Newslettertool

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26908

    Hey i want to send one or some Fields after Event Booking into a Newslettertool like quentn.
    There i have an API.

    How can connect it?

    Christoph Steinlechner
    #26969

    I can’t advise on how to connect to Newslettertool’s API (they probably have a library you can use that will help with that?).

    I can advise on how to hook into Event Organiser’s booking flow.

    If you wanted to add a user when the booking is initially made (not necessarily confirmed) you can use the hook eventorganiser_new_booking:

    add_action( 'eventorganiser_new_booking', function( $booking_id ) {
        // Get field with ID 5:
        $value = eo_get_booking_meta( $booking_id, 'meta_5' );
    
        // Do something
    } );
    

    That fires before the booking is confirmed so you may want to use the eventorganiser_transition_booking_status hook to connect to the Newsletter API when a booking is confirmed:

    add_filter( 'eventorganiser_transition_booking_status', function( $new_status, $old_status, $booking_id ) {
         if ( 'pending' === $old_status && 'confirmed' === $new_status ) {
                // Booking going from pending to confirmed
                // Do something
         }
    }, 10, 3 );
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.