Tagged: , ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #43443
    Anonymous
    Inactive

    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 );
    }
    }

    #48390
    Franky
    Keymaster

    Try this:

    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 );
    }
    }

    #48391
    Anonymous
    Inactive

    No, it is not working. The result is : &event_id=Arrayevent_id.

    #48392
    Franky
    Keymaster

    BBbpress seems to remove some characters, see that the last part contains $event (with the square brackets)

    #48393
    Anonymous
    Inactive

    No, it is not working. Maybe it is because the addition of the id is made after the creation of an event and the hook is before this. Do you have an other idea?

    #48394
    Franky
    Keymaster

    No, the ID was known … but just not filled in the array 🙂

    Fixed in trunk, see here: http://plugins.trac.wordpress.org/changeset/428800

    #48395
    Anonymous
    Inactive

    Why since the last update, this hook is not working? :

    if ($event[event_status] == 5) {

    wp_mail( $to, $subject, $message );

    }

    #48396
    Franky
    Keymaster

    Have you done a “print_r($event)” to see what’s in it?

    #48397
    Anonymous
    Inactive

    OK, thanks. It needed the ‘ in $event[event_status] like $event.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top