As for the email input form, you can use any plugin for Custom Fields ( I use Advanced Custom Fields or Custom Content Type Manager ) or add you own meta box ( tutorial ).
And for sending an email to the address inserted as a custom field, use the following code.
The custom field is named email_warn.
The filter wp_mail_content_type
enables html content for emails.
And add_attachment
will fire at each upload, pull the parent ID and send an email if the custom field is defined and is a valid email
add_filter( 'wp_mail_content_type', 'wpse_20324_mail_html' );
add_filter( 'add_attachment', 'wpse_20324_post_upload' );
function wpse_20324_mail_html()
{
return "text/html";
}
function wpse_20324_post_upload( $attachment_ID )
{
$uploaded = get_post( $attachment_ID );
$email = get_post_meta( $uploaded->post_parent, 'email_warn', true );
if( isset( $email ) && is_email( $email ) )
{
/**
* The message will contain all post info about the uploaded file
*/
$vardump = print_r( $uploaded, true );
$message="<pre>" . $vardump . '</pre>';
$headers="From: Test WPSE <[email protected]>" . "\r\n";
wp_mail( $email, 'subject', $message, $headers );
}
}