1 reputation
2
bio website
location
age
visits member for 2 years, 5 months
seen Mar 13 at 11:25

Oct
24
comment Sends out email to admin with post author
I try this add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){ $to = 'adress@email.fr'; $subject = "Un nouveau contrat SMP-PRO a été enregistré par".get_userdata($post->post_author); $message = "Sandra, le dossier ".get_the_title($post_id)." est visible sur cette page : ".get_edit_post_link( $id, $context ); wp_mail($to, $subject, $message ); } but it's not working… :(
Oct
24
comment Sends out email to admin with post author
I forgot to say, my code work perfectly but i want to "add" the author in the mail.
Oct
24
comment Sends out email to admin with post author
I'm french so i don't understand your Ref very well. Sorry. :s
Oct
24
comment Sends out email to admin with post author
Like that ? : add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){global $post; $to = 'admin@email.here'; $subject = 'subject'; $message = "The author is :".get_the_author(); wp_mail($to, $subject, $message );
Oct
24
asked Sends out email to admin with post author
Aug
31
awarded  Editor
May
14
awarded  Tumbleweed