Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active January 1, 2016 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/161c70daf6632addd0af to your computer and use it in GitHub Desktop.
Save mikejolley/161c70daf6632addd0af to your computer and use it in GitHub Desktop.
$send_to = '';
$email = get_post_meta( $post->ID, '_application', true );
$user = $post->post_author;
if ( is_email( $email ) ) {
$send_to = $email;
} elseif ( $user ) {
$user = get_user_by( 'id', $user );
$send_to = $user->user_email;
}
if ( ! $send_to )
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment