Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wcfm_membership_registration', function ($member_id) {
- if (apply_filters('wcfm_is_pref_membership', true)) {
- $member_id = absint( $member_id );
- $member_user = new WP_User( absint( $member_id ) );
- $wcfm_membership_options = get_option('wcfm_membership_options', array());
- $membership_reject_rules = array();
- if (isset($wcfm_membership_options['membership_reject_rules'])) $membership_reject_rules = $wcfm_membership_options['membership_reject_rules'];
- $required_approval = isset($membership_reject_rules['required_approval']) ? $membership_reject_rules['required_approval'] : 'no';
- if ($required_approval == 'yes' && !wcfm_is_vendor($member_id)) {
- if (!defined('DOING_WCFM_EMAIL'))
- define('DOING_WCFM_EMAIL', true);
- $notification_subject = '[{site_name}] Your application is submitted';
- $notication_content = "Welcome {first_name},<br/>" .
- "You have successfully submitted your Vendor Account request.<br/>" .
- "Your Vendor application is still under review.<br/>" .
- "You will receive details about our decision in your email within next 48 hours!<br/>" .
- "Thank You!";
- $subject = str_replace( '{site_name}', get_bloginfo( 'name' ), $notification_subject );
- $subject = apply_filters( 'wcfm_email_subject_wrapper', $subject );
- $message = str_replace( '{first_name}', $member_user->first_name, $notication_content );
- $message = apply_filters( 'wcfm_email_content_wrapper', $message, __( 'Pending for approval', 'wc-multivendor-membership' ) );
- wp_mail( $member_user->user_email, $subject, $message );
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement