Forum Replies Created

Viewing 15 replies - 16 through 30 (of 56 total)
  • Thread Starter pvwij

    (@pvwij)

    That solved the problem. Thank you for your’e quick response.

    Thread Starter pvwij

    (@pvwij)

    Thanks a lot, that did the trick.

    Thread Starter pvwij

    (@pvwij)

    Hi Franky,

    It doesn’t work as you describe above:

    My EME settings:
    Enable approved RSVP e-mails = On
    Enable paid RSVP e-mails = On

    Event settings:
    Auto approve when paid = On
    Approve is needed = On

    Payment mail is sent, approve mail is not sent.

    Why is this changed? I really need payment mail AND approve mail

    Thread Starter pvwij

    (@pvwij)

    Yes. I also have checked the logfiles on the server and there was only sent one email instead of two. I also have checked the log for a booking where the systems has sent two e-mails and they were also visible in the server logfiles.

    Thread Starter pvwij

    (@pvwij)

    This was the none working code:

    <?php 
    
    	 add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    	 function my_theme_enqueue_styles() { 
     		  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); 
     		  } 
    /**
     * Remove the href from empty links <code><a href=&quot;#&quot;></code> in the nav menus
     * @param string $menu the current menu HTML
     * @return string the modified menu HTML
     */
    function wpse_remove_empty_links( $menu ) {
        return str_replace( '<a href="#">', '<a>', $menu );
    }
    
    add_filter( 'wp_nav_menu_items', 'wpse_remove_empty_links' );
    add_filter('show_admin_bar', '__return_false');
    
    /**
     * Change Default Display Name (Powered by yeahhub.com)
     */
     
    function change_display_name( $user_id ) {
     $info = get_userdata( $user_id );
     $args = array(
     'ID' => $user_id,
     'display_name' => $info->first_name . ' ' . $info->last_name
     );
     wp_update_user( $args );
    }
    add_action('user_register','change_display_name');
    
    function my_formfield_filter($formfield,$postfield_name,$value) {
        // do a print_r of $formfield, etc ... to see the content. Check the wordpress userid with wp_get_current_user() and do all magic you want :-)
        // as an example, let's change the value of a field if it is called 'testfield')
        $current_user = wp_get_current_user();
        $jbn = $current_user->jbn_number;
    	$telefoon = $current_user->phone;
    	$geboortedatum = $current_user->birth;
    	$gebdatum = date("d-m-Y", strtotime($geboortedatum));
    	if ($formfield['field_name']=='JBN Nummer') {
           return $jbn;
    	} elseif ($formfield['field_name']=='Geboortedatum') {
           return $gebdatum;
        } elseif ($formfield['field_name']=='Test') {
           return $telefoon;
        } else {
           return $value;
        }
    }
    add_filter('eme_field_value_filter','my_formfield_filter',10,3);
    
    add_filter( 'wpmem_notify_addr', 'my_admin_email' );
     
    function my_admin_email( $email ) {
     
        // single email example
        // $email = '[email protected]';
         
        // multiple emails example
        // $email = '[email protected], [email protected]';
         
        // take the default and append a second address to it example:
        $email = $email . ', [email protected]';
         
        // return the result
        return $email;
    
    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name) {
        $booking_ids = eme_get_payment_booking_ids($payment['id']);
        $booking = eme_get_booking($booking_ids[0]);
        $event = eme_get_event($booking['event_id']);
        $person = eme_get_person($booking['person_id']);
        $lastname = $person['lastname'];
        $firstname = $person['firstname'];
        $evenement = $event['event_name'];
        $description = "Betaling van $firstname $lastname voor $evenement";
        return $description;
    }
    add_filter('eme_rsvp_paymentform_description_filter','my_eme_rsvp_payment_descr',10,3);
    	
    }
    
    ?>

    This is the code that works (after I placed the filter to the top;

    <?php 
    
    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name) {
        $booking_ids = eme_get_payment_booking_ids($payment['id']);
        $booking = eme_get_booking($booking_ids[0]);
        $event = eme_get_event($booking['event_id']);
        $person = eme_get_person($booking['person_id']);
        $lastname = $person['lastname'];
        $firstname = $person['firstname'];
        $evenement = $event['event_name'];
        $description = "Betaling van $firstname $lastname voor $evenement";
        return $description;
    }
    add_filter('eme_rsvp_paymentform_description_filter','my_eme_rsvp_payment_descr',10,3);
    
    	 add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    	 function my_theme_enqueue_styles() { 
     		  wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); 
     		  } 
    /**
     * Remove the href from empty links <code><a href=&quot;#&quot;></code> in the nav menus
     * @param string $menu the current menu HTML
     * @return string the modified menu HTML
     */
    function wpse_remove_empty_links( $menu ) {
        return str_replace( '<a href="#">', '<a>', $menu );
    }
    
    add_filter( 'wp_nav_menu_items', 'wpse_remove_empty_links' );
    add_filter('show_admin_bar', '__return_false');
    
    /**
     * Change Default Display Name (Powered by yeahhub.com)
     */
     
    function change_display_name( $user_id ) {
     $info = get_userdata( $user_id );
     $args = array(
     'ID' => $user_id,
     'display_name' => $info->first_name . ' ' . $info->last_name
     );
     wp_update_user( $args );
    }
    add_action('user_register','change_display_name');
    
    function my_formfield_filter($formfield,$postfield_name,$value) {
        // do a print_r of $formfield, etc ... to see the content. Check the wordpress userid with wp_get_current_user() and do all magic you want :-)
        // as an example, let's change the value of a field if it is called 'testfield')
        $current_user = wp_get_current_user();
        $jbn = $current_user->jbn_number;
    	$telefoon = $current_user->phone;
    	$geboortedatum = $current_user->birth;
    	$gebdatum = date("d-m-Y", strtotime($geboortedatum));
    	if ($formfield['field_name']=='JBN Nummer') {
           return $jbn;
    	} elseif ($formfield['field_name']=='Geboortedatum') {
           return $gebdatum;
        } elseif ($formfield['field_name']=='Test') {
           return $telefoon;
        } else {
           return $value;
        }
    }
    add_filter('eme_field_value_filter','my_formfield_filter',10,3);
    
    add_filter( 'wpmem_notify_addr', 'my_admin_email' );
     
    function my_admin_email( $email ) {
     
        // single email example
        // $email = '[email protected]';
         
        // multiple emails example
        // $email = '[email protected], [email protected]';
         
        // take the default and append a second address to it example:
        $email = $email . ', [email protected]';
         
        // return the result
        return $email;
    	
    }
    
    ?>
    • This reply was modified 7 years, 3 months ago by pvwij.
    Thread Starter pvwij

    (@pvwij)

    I have placed the filter in the top of my functions.php and now it seems to work.

    Thread Starter pvwij

    (@pvwij)

    Response admin-ajax.php:

    Betaling van Patrick van Wijk voor TEST{“Result”:”OK”,”keep_form”:0,”htmlmessage”:”LET OP:<\/strong><br \/>\n<br \/>\nMoet er voor je inschrijving betaald worden:<br \/>\nJe inschrijving is opgeslagen maar nog niet definitief. Na ontvangst van je betaling is je inschrijving pas definitief.<\/em><br \/>\n<br \/>\nBetaal je inschrijving direct met iDeal door hieronder op de betaalknop te klikken.<\/strong>”,”paymentform”:”<div id=’eme-payment-handling’ class=’eme-payment-handling’>Afhandelen betaling<\/div><div id=’eme-payment-price-info’ class=’eme-payment-price-info’>De prijs in EUR is: 1.00<\/div><div id=’eme-payment-form’ class=’eme-payment-form’><br \/><form action=’https:\/\/www.mollie.com\/paymentscreen\/issuer\/select\/ideal\/CMbwGQNnBT’ method=’get’><input type=’submit’ value=’BETALEN’ \/><br \/>iDEAL <\/form><\/div>”}

    Thread Starter pvwij

    (@pvwij)

    i have used the new code and it is still not working. The description is unchanged. (sorry, I have no access to the PHP log files. I will contact the hosting provider next week)

    print_r ($description); doesn’t show anything.

    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name) {
        $booking_ids = eme_get_payment_booking_ids($payment['id']);
        $booking = eme_get_booking($booking_ids[0]);
        $event = eme_get_event($booking['event_id']);
        $person = eme_get_person($booking['person_id']);
        $lastname = $person['lastname'];
        $firstname = $person['firstname'];
        $evenement = $event['event_name'];
        $description = "Betaling van $firstname $lastname voor $evenement";
        print_r ($description);
        return $description;
    }
    add_filter('eme_rsvp_paymentform_description_filter','my_eme_rsvp_payment_descr',10,3);
    • This reply was modified 7 years, 3 months ago by pvwij.
    • This reply was modified 7 years, 3 months ago by pvwij.
    • This reply was modified 7 years, 3 months ago by pvwij.
    • This reply was modified 7 years, 3 months ago by pvwij.
    Thread Starter pvwij

    (@pvwij)

    Thanks a lot for your’e response. I wasn’t able (yesterday) to reach the php log files. Also the description was not changed partially, nothing was changed on the description.

    Thread Starter pvwij

    (@pvwij)

    In filter:
    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name)

    In eme_payments.php:
    $name=apply_filters($filtername,$name,$payment,$gateway);

    Is this ok?

    Thread Starter pvwij

    (@pvwij)

    In filter:
    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name)

    In eme_payments.php:
    $name=apply_filters($filtername,$name,$payment,$gateway);

    Is this ok?

    • This reply was modified 7 years, 3 months ago by pvwij.
    Thread Starter pvwij

    (@pvwij)

    Yes, the same way I added the rsvp form filter. Priority of both is set to 10, is that a possible problem?

    Thread Starter pvwij

    (@pvwij)

    Gateway is Mollie.

    Thread Starter pvwij

    (@pvwij)

    Is my code as mentioned above correct? Is it technically valid? (I did read some information about filters)

    • This reply was modified 7 years, 3 months ago by pvwij.
    Thread Starter pvwij

    (@pvwij)

    Is it possible that the following in the code of eme_payments.php is wrong:

    if (has_filter($filtername))
    $name=apply_filters($filtername,$name,$payment,$gateway);

    Missing spaces:
    $name = apply_filters($filtername,$name,$payment,$gateway);

    • This reply was modified 7 years, 3 months ago by pvwij.
    • This reply was modified 7 years, 3 months ago by pvwij.
    • This reply was modified 7 years, 3 months ago by pvwij.
Viewing 15 replies - 16 through 30 (of 56 total)