Events Made Easy Forums How do I … Add member from RSVP if there select yes to become member field

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #57389
    Anonymous
    Inactive

    Hi
    I have a RSVP form for an event we are running. In the form I have a dynamic section for employees. Within that users have an option to become members of our internal club.
    I would like to automate that membership if they have set this to yes.

    I think I can use the hook eme_insert_rsvp_action but I am just not sure how to get the right variables from the RSVP form.
    I think the it would be something like the below but obviously with he correct vars and syntax

    add_action('eme_insert_rsvp_action', 'register_new_user');
    
    if want_to_be_member=yes
    firstname=Bookings_firstname
    surname=Bookings_surname
    user_email=Bookings_email
    user_login=$firstname.$surname
    
    register_new_user( $user_login, $user_email )

    This is my form template for the RSVP

       <table class='eme-rsvp-form'>
    <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr>
    <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr>
    <tr><th scope='row'>E-Mail*:</th><td>#_EMAIL</td></tr>
    <tr><th scope='row'>Phone number*:</th><td>#REQ_PHONE</td></tr>
    <tr><th scope='row'>Distance:</th><td>#_FIELD{3}</td></tr>
    <tr><th scope='row'>Cycling Experience:</th><td>#_FIELD{Cycling_Experience}</td></tr>
    <tr><th scope='row'>Sportive Experience:</th><td>#_FIELD{Sportive_Experience}</td></tr>
    <tr><th scope='row'>Emergency Contact Name*:</th><td>#REQ_FIELD{1}</td></tr>
    <tr><th scope='row'>Emergency Contact Tel*:</th><td>#REQ_FIELD{2}</td></tr>
    #_CAPTCHAHTML{<tr><th scope='row'>Please fill in the code displayed here:</th><td>#_CAPTCHA</td></tr>}
    <tr><th scope='row'>company Employee:</th><td>#_FIELD{company_Employee} If not name referrer in comments</td></tr>
    </table>
    <table class='eme-rsvp-form'>
    #_DYNAMICDATA
    </table>
    <strong>Additional Comments/notes:</strong>#_COMMENT
    <strong>Confirm waiver & terms acceptance*:<br> waiver form link</strong> <br>#_FIELD{4}
    
    #_SUBMIT
    <p hidden>#_SPACES</p>

    And this is for the dynamic data

    <tr><th scope='row' align="right">Department:</th><td><br>#_FIELD{Department}</td></tr>
    <tr><th scope='row' align="right">Main place of work:</th><br><td>#_FIELD{Main_place_of_work}</td></tr>
    <tr><th scope='row' align="right">Join company Cycle Club?:</th><br><td>#_FIELD{Join_companyClub}</td></tr>

    Any tips on getting the hook right as I am a bit of a WordPress novice.

    Thanks
    Ben

    #57390
    Franky
    Keymaster

    Check the doc on hooks/filters: http://www.e-dynamics.be/wordpress/category/documentation/12-hooks-and-filters/
    The eme_insert_rsvp_action only takes $booking as an argument, you’d need to call eme-related functions inside your php code.
    You do know EME has a complete club-membership management code too, no?

    #57392
    Anonymous
    Inactive

    Hey Franky
    Yep I have been looking at the hooks, afraid its been about 10 years since I have done anything on WordPress/php so struggling a bit.

    I just want people attending our cycling event to also become a member when they sign up for the event. I thought I could do it with an option in the event form, I just need to work out the hook.
    Is there an easy way to use the membership features of your plugin to do this?

    Thanks
    Ben

    #57394
    Franky
    Keymaster

    Concerning your hook: you should invest some time to do what you want there. Base yourself on this code:

    add_action('eme_insert_rsvp_action', 'my_eme_function',20,1);
    function my_eme_function($booking) {
       $booking_id = $booking['booking_id'];
       $event_id = $booking['event_id'];
       $answers = eme_get_answers($booking_id);
       print_r($answers); 
       return;
    }

    And the member-functionality is very complete btw …

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top