To send an email when someone add an event (draft), I use a hook. I’m trying to get the $event[event_id] array but it is not working. Do you have an idea?
//This is the code
add_action('eme_insert_event_action','email_to');
function email_to($event) {
$to = 'webmaster@ecdq.org';
$subject = 'Nouvelle activité';
$message = "Une nouvelle activité « $event[event_name] » attend votre vérification."."rnn"." Vérifier l'activité :"."n"." http://beta.ecdq.org/wp-admin/admin.php?page=events-manager&action=edit_event&event_id=$event[event_id].";
if ($event[event_status] == 5) {
wp_mail( $to, $subject, $message );
}
}