Plugin Author
Franky
(@liedekef)
It is not in there because nobody ever requested it, and since the EME action hook provides a similar functionality, it is not needed.
Just add the example about eme_insert_event_action found on http://www.e-dynamics.be/wordpress/category/documentation/12-hooks-and-filters/ to your theme’s functions.php file and you’re good to go (just don’t forget to change the subject/content in the example and also remove the for-loop and replace by a 1-line eme_send_mail-call with just your email info).
I added the following code to my functions.php file and I am now receiving emails from the frontend form. But I receive an email whenever a new event is added to the database – frontend or backend. I only want to receive the notifications when the frontend form is submitted.
add_action(’eme_insert_event_action’,’eme_mail_event’);
function eme_mail_event ($event) {
$contact = eme_get_contact ($event);
$contact_email = “email@myemail.com”;
$subject_format=”An New Event Has Been Submitted ‘ #_EVENTNAME ‘”;
$body_format=”An New Event Has Been Submitted <br /><br /> #_EVENTNAME in #_TOWN, #_STATE <br /> #_EVENTDETAILS <br /><br />
#_STARTDATE at #_STARTTIME to #_ENDDATE at #_ENDTIME <br /><br /> Contact: #_CONTACTEMAIL<br /> <br /> Please log into the admin to approve the event.”;
$subject=eme_replace_placeholders($subject_format, $event, “text”);
$body=eme_replace_placeholders($body_format, $event, “text”);
eme_send_mail($subject,$body,$contact_email);
}
Plugin Author
Franky
(@liedekef)
I asume you want to check/approve draft events.
Then add an extra check:
if ($event['event_status']==STATUS_DRAFT) {
...}
I get 500error when I put this in my functions.php?