Events Made Easy › Forums › Generic › e-mail information sent to a group at each new event
- This topic has 4 replies, 2 voices, and was last updated 2 years, 10 months ago by Anonymous.
-
AuthorPosts
-
Fri 4 Feb 2022 at 18:22 #63819AnonymousInactive
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);
}Sat 5 Feb 2022 at 10:04 #63820FrankyKeymasterThe 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 changeadd_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.
Sat 5 Feb 2022 at 10:07 #63821AnonymousInactiveThanks Franky for your quick answer I will test. How to get the same delivery if the event is scheduled from the admin ?
Sat 5 Feb 2022 at 10:26 #63822FrankyKeymasterFor that you can leave the current add_action calling eme_insert_event_action.
Sat 5 Feb 2022 at 18:23 #63823AnonymousInactiveOk Franky. All is fine. Thanks for all. Have a good week-end 🙂
Frédéric -
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.