Events Made Easy › Forums › How do I … › Add member from RSVP if there select yes to become member field
- This topic has 3 replies, 2 voices, and was last updated 6 years, 10 months ago by Franky.
-
AuthorPosts
-
Sun 21 Jan 2018 at 20:04 #57389AnonymousInactive
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 syntaxadd_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
BenSun 21 Jan 2018 at 21:33 #57390FrankyKeymasterCheck 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?Sun 21 Jan 2018 at 23:19 #57392AnonymousInactiveHey 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
BenMon 22 Jan 2018 at 19:18 #57394FrankyKeymasterConcerning 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 …
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.