All files are saved as custom post types nm-userfiles and uploaded file is attached as post attachment. All directories are also custom posts but without any attachment.
Table of Contents
ToggleChange From Email
add_filter('fileupload_from_email', 'change_from_email'); function change_from_email($dedault_email){ return 'any@otheremail.com'; }
Change Subject
add_filter('fileupload_subject', 'change_subject', 10, 2); function change_subject($dedault_subject, $file_name){ return 'A new file ' . $file_name . ' is uploaded '; }
Change Recipients
add_filter('fileupload_receivers', 'change_receivers'); function change_receivers($dedault_receivers){ $dedault_receivers[] = 'new@email.com'; return $dedault_receivers; }
Change Email Message (Body)
add_filter('fileupload_message', 'change_message', 10, 2); function change_message($message, $args){ $file_meta = ''; if($args){ foreach($args['file_meta'] as $key => $val){ $file_meta .= $key .': '.$val.' '; } $message .= ' ' . $file_meta; } return $message; }