Hello i'm using this :
add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){
$to = 'admin@email.here';
$subject = 'subject';
$message = "Here is :".get_permalink($post_id);
wp_mail($to, $subject, $message );
to send out a mail to wordpress admin when a post is publish by author. And I would like to add the post author in $message.
I try get_the_author(); and the_author();
but nothing happens.
Any ideas guys ?
Thank u !
(Sorry i'm french)