Advertisement
palsushobhan

wcfm_vendor_registration_pending_email

Feb 6th, 2025
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. add_action('wcfm_membership_registration', function ($member_id) {
  2.     if (apply_filters('wcfm_is_pref_membership', true)) {
  3.         $member_id       = absint( $member_id );
  4.         $member_user     = new WP_User( absint( $member_id ) );
  5.         $wcfm_membership_options = get_option('wcfm_membership_options', array());
  6.         $membership_reject_rules = array();
  7.         if (isset($wcfm_membership_options['membership_reject_rules'])) $membership_reject_rules = $wcfm_membership_options['membership_reject_rules'];
  8.         $required_approval = isset($membership_reject_rules['required_approval']) ? $membership_reject_rules['required_approval'] : 'no';
  9.  
  10.         if ($required_approval == 'yes' && !wcfm_is_vendor($member_id)) {
  11.             if (!defined('DOING_WCFM_EMAIL'))
  12.                 define('DOING_WCFM_EMAIL', true);
  13.  
  14.             $notification_subject = '[{site_name}] Your application is submitted';
  15.            
  16.             $notication_content = "Welcome {first_name},<br/>" .
  17.             "You have successfully submitted your Vendor Account request.<br/>" .
  18.             "Your Vendor application is still under review.<br/>" .
  19.             "You will receive details about our decision in your email within next 48 hours!<br/>" .
  20.             "Thank You!";
  21.  
  22.             $subject = str_replace( '{site_name}', get_bloginfo( 'name' ), $notification_subject );
  23.             $subject = apply_filters( 'wcfm_email_subject_wrapper', $subject );
  24.             $message = str_replace( '{first_name}',  $member_user->first_name, $notication_content );
  25.  
  26.             $message = apply_filters( 'wcfm_email_content_wrapper', $message, __( 'Pending for approval', 'wc-multivendor-membership' ) );
  27.            
  28.             wp_mail( $member_user->user_email, $subject, $message );
  29.  
  30.         }
  31.     }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement