Last active
          May 27, 2023 07:11 
        
      - 
      
- 
        Save max-kk/396d7da80c722c0527b2810c8aaadc18 to your computer and use it in GitHub Desktop. 
    LRM :: extra_mail_args
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // User Emails | |
| add_filter("lrm/mails/registration/body", function($mail_body, $user_login, $userdata, $user) { | |
| // Let's replace the {{USER_PHONE}} tag with user meta value | |
| $mail_body = str_replace( '{{USER_PHONE}}', get_user_meta($user->ID, 'phone', true), $mail_body ); | |
| return $mail_body; | |
| }, 10, 4); | |
| //$mail_body = apply_filters("lrm/mails/registration/body", $mail_body, $user->user_login, $userdata, $user); | |
| // Admin Emails | |
| add_filter("lrm/mails/registration_to_admin/body", function($mail_body, $user_login, $userdata, $user) { | |
| // Let's replace the {{USER_PHONE}} tag with user meta value | |
| $mail_body = str_replace( '{{USER_PHONE}}', get_user_meta($user->ID, 'phone', true), $mail_body ); | |
| return $mail_body; | |
| }, 10, 4); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| //$mail_body = apply_filters("lrm/mails/registration/body", $mail_body, $user->user_login, $userdata, $user); | |
| // FOr Admin Email use "lrm/mails/registration_to_admin/body" | |
| add_filter("lrm/mails/registration/body", function($mail_body, $user_login, $userdata, $user) { | |
| // Let's replace the {{USER_PHONE}} tag with user meta value | |
| $mail_body = str_replace( '{{USER_PHONE}}', $_POST['phone'], $mail_body ); | |
| return $mail_body; | |
| }, 10, 4); | 
+1 Not working here. Would love to have the custom field in the admin Mail. Thx!
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
This is not working, my custom fields are getting saved on the backend but not able to send them in email.