Fix or rewrite a wordpress function for Memberpress and New User Approve plugin.
Site I’m working on requires users to apply before they can join, so using a free membership for sign up and the Approve New Users plugin to approve their membership.
Users fill out their details and choose a membership option when they apply (but don't pay at that stage), and on approval I need to send them an email with a link to the specific membership level they have chosen.
I’m trying to figure out a function that will send an email on approval, so check the membership option chosen when applying and send email. I have the attached put together from various sources, but it's throwing an error. I need the function to be fixed, or rewritten.
Last errors from log:
[30-May-2024 22:44:04 UTC] PHP Notice: Trying to get property 'user_email' of non-object in xxxxxxx on line 182[30-May-2024 22:44:04 UTC] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in xxxxxxxxxxxx/functions.php on line 220[30-May-2024 22:44:04 UTC] No matching value found for 'mepr_i_wish_to_apply_for':
Have checked and the field does contain values, ie:mepr_i_wish_to_apply_for: a:1:{s:6:"annual";s:2:"on";}
thanksBen
Success story sharing