• Resolved from-scratch

    (@from-scratch)


    [I have the Pro version 5.6.6.1]

    Hi,

    As an administrator, I would like to get (in the email notification I received after a booking) the name of the gateway choosen by the user that registered to the event.
    I can’t see anything for that here: https://wp-events-plugin.com/documentation/placeholders/
    Any idea how/where to get it?

    And this information is also not available in the back-end. Unless I just can’t see it..?

    The only way I found is to go in the database directly..

    Many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could try using this code and place it in your functions.php of theme. Then you could use the placeholder: #_PAYMENTGATEWAY to show the payment gateway used

    /**
    This snippet will add new placeholder #_PAYMENTGATEWAY
    to determine what gateway is used when the event is booked.
    */
    add_filter('em_booking_output_placeholder','my_em_get_payment_type',1,3);
    function my_em_get_payment_type($replace, $EM_Booking, $result){
        global $wp_query, $wp_rewrite, $wpdb;;
        switch( $result ){
            case '#_PAYMENTGATEWAY':
                $replace = '';
                            $sql = $wpdb->prepare( "SELECT transaction_gateway FROM ".EM_TRANSACTIONS_TABLE." WHERE booking_id= '".$EM_Booking->booking_id."' ");
                            $gateway = $wpdb->get_var($sql);
                            $replace = $gateway;
                break;
        }
        return $replace;
    }
    Thread Starter from-scratch

    (@from-scratch)

    Thanks a lot for your time & help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gateway placeholder in an email’ is closed to new replies.