I got it working by looking at this post/answer:
https://wordpress.stackexchange.com/a/134283/17126
Seems it can’t be done, and I changed the get_post_meta
line to:
$message .= 'Email: ' . sanitize_text_field($_POST['_email']) . '<br>';
Also, I could see the $_POST
data coming in from post.php on submission over dev tools.
And finally, I changed my hook to publish_cpt
which you can read more about here:
https://codex.wordpress.org/Post_Status_Transitions
All good now!