tribe_events_update_meta Triggers Twice

Home Forums Calendar Products Community Events tribe_events_update_meta Triggers Twice

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40770
    Dan
    Participant

    I’m trying to send a customized email when an event is submitted on the front event via Community Events. I hooked my function onto the tribe_events_update_meta action, but it is firing twice.

    add_action(‘tribe_events_update_meta’, ‘pcs_send_confirmation_email’,10,4);
    function pcs_send_confirmation_email($event_id, $false=false, $data=false, $event=false){
    if($false[“community-event”] == ‘Submit Event’) mail(‘[email protected]’,$event_id,$false);
    }

    Any thoughts or ideas for other actions to hook onto after the event has been saved? Thanks.

    #40830
    Casey
    Participant

    Dan,
    Thanks for reaching out. Just to clarify, is this happening when events are submitted on the front-end or the back-end? Or both?

    #40833
    Dan
    Participant

    Casey. Definitely the frontend, not sure if it’s happening on the backend. I noticed that the two $false arrays were different though and that the second one held a few more keys (http://pastebin.com/nnUwP2DZ). For the mean time I am doing a quick fix by only targeting the second action based on a conditional for a key in the second array that’s not in the first.

    #40834
    Casey
    Participant

    Dan,
    Great to hear that you’ve got a workaround. You might also try submitting events from the back-end to see if it still triggers twice or not. Just let me know if you need more help with this. Thanks!

    #978688
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘tribe_events_update_meta Triggers Twice’ is closed to new replies.