Events Made Easy Forums Generic e-mail information sent to a group at each new event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #63819
    Anonymous
    Inactive

    Hi Franky

    I have been using this hook, below, in the function.php file of my theme for 2 years as the example you show in your documentation.
    It worked until 3 weeks ago (I don’t have a lot of event programming at the moment) but today it didn’t work. The event is created via EMEFS. Is it due to a plugin or WP update? I don’t know. Can you check and tell me if you have any idea ?

    add_action(’eme_insert_event_action’,’eme_mail_event’);
    function eme_mail_event ($event) {
    $contact = eme_get_event_contact ($event);
    $contact_email = $contact->user_email;
    $contact_name = $contact->display_name;
    $subject_format=”Vogue et Rêve – Une nouvelle navigation a été programmée ‘ #_EVENTNAME ‘”;
    $body_format=”Bonjour <br>Un nouvel évènement a été mis en ligne sur Vogue et Rêve. <br>
    Son nom est <b> #_EVENTNAME </b>, <br>
    Il a lieu le <b>#_STARTDATE à #_STARTTIME</b> organisé par #_AUTHORDISPNAME <br><br>
    #_LOCATIONIMAGETHUMB<br>
    Vous serez sur le voilier <b>#_LOCATIONNAME</b>
    <br>
    <br>
    Vous devrez vous identifier pour réserver ici <br>
    <br>
    Si vous souhaitez vous désinscrire de ce type de message cliquez ici <br><br>
    Le Webmaster”;
    $subject=eme_replace_placeholders($subject_format, $event, “text”);
    $body=eme_replace_placeholders($body_format, $event);
    $person_ids=eme_get_groups_person_ids(6);
    foreach ( $person_ids as $person_id ) {
    $person=eme_get_person($person_id);
    $person_name=eme_format_full_name($person[‘firstname’],$person[‘lastname’]);
    eme_send_mail($subject,$body, $person[’email’], $person_name, $contact_email, $contact_name);
    }

    #63820
    Franky
    Keymaster

    The code is fine, but the eme_insert_event_action is now called on a different place, so no longer at db insert (but after some more actions done). This was needed for all info to be available in $event.
    But since you use EMEFS, this action is no longer triggered. However, EMEFS foresees its own action hook for this: emefs_submit_event_action. So change

    
    add_action(’eme_insert_event_action’,’eme_mail_event’);
    

    to

    
    add_action(’emefs_submit_event_action’,’eme_mail_event’);
    

    And you should be good to go.

    #63821
    Anonymous
    Inactive

    Thanks Franky for your quick answer I will test. How to get the same delivery if the event is scheduled from the admin ?

    #63822
    Franky
    Keymaster

    For that you can leave the current add_action calling eme_insert_event_action.

    #63823
    Anonymous
    Inactive

    Ok Franky. All is fine. Thanks for all. Have a good week-end 🙂
    Frédéric

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top