Support » Plugin: Events Made Easy Frontend Submit » Notifications of Submissions

  • Resolved jbellle74

    (@jbellle74)


    Why is there not an option to receive email notifications once the form is submitted? How will I know when one of my users submits an event to the site that I need to approve? Seems like an obvious oversight that could be easily remedied in the settings area (specify an email address for notifications to be sent). I saw the reference to use a hook, but that code means nothing to me. How do I set it up for this specific submission form? The plugin otherwise works great.

    http://www.e-dynamics.be/wordpress/?cat=41

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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).

    Thread Starter jbellle74

    (@jbellle74)

    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Notifications of Submissions’ is closed to new replies.