Events Made Easy Forums How do I … Send email to Admin when draft event is submitted

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #59663
    Anonymous
    Inactive

    I installed your plugin (Events Made Easy) on a website and am wondering where to enter my email address on the plugin to have it send me notifications when someone adds an event (which will go into drafts first.)

    I’ve looked all over the plugin to find this option but can not find it.

    What I’m looking for is a NOTIFY ME OF EVENT DRAFTS VIA EMAIL

    #59664
    Anonymous
    Inactive

    I looked in 12 – Hooks and filters and could not find the answer.

    #59666
    Franky
    Keymaster

    Look again, see the hook “eme_insert_event_action”

    #59668
    Anonymous
    Inactive

    How do I modify “eme_insert_event_action” to only send email to admin? or where to add email address (for notification of new draft?

    I am a ‘codeless’ person.

    #59669
    Franky
    Keymaster

    IF you’re codeless, then the action hooks are not for you. While I provide EME support and guidance, I’m not providing php courses 🙂
    But the example is pretty clear to me … replace

       $blogusers = get_users();
       foreach ( $blogusers as $user ) {
          eme_send_mail($subject,$body, $user->user_email, $user->display_name, $contact_email, $contact_name);
       }

    by just
    eme_send_mail($subject,$body, "my_admin_email", "my_admin_name", $contact_email, $contact_name);
    and replace there my_admin_email and my_admin_name by whatever you want.

    #59674
    Anonymous
    Inactive

    Sadly, I’ve been a mere illustrator/designer/graphic designer since 1971 and have been drawn reluctantly into the digital world since 1997.

    It will be interesting to check out your documentation on the web: https://www.e-dynamics.be/wordpress/category/documentation/ Thank-you for posting this info!

    Perhaps I can be converted into being a ‘codist.’ I’ve picked up more and more as each year goes by. However there are big holes in my knowledge since I am self-taught. PHP & scripts can be scary for me whenever I meet it …

    Thank you for your responses.

    OK, now that I have this:

    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="This is the new event called ' #_EVENTNAME '";
       $body_format="This is the new event called ' #_EVENTNAME '";
    
       $subject=eme_replace_placeholders($subject_format, $event, "text");
       $body=eme_replace_placeholders($body_format, $event, "text");
        {
         eme_send_mail($subject,$body, "my email”, “my name”, $contact_email, $contact_name);   }
    }

    Where do I insert this? I looked around, but it was not visible to me.

    #59675
    Franky
    Keymaster

    See the doc: https://www.e-dynamics.be/wordpress/category/documentation/12-hooks-and-filters/
    It explains it there: in your theme functions.php (and best create a theme-child and put it in there, so if your theme updates you don’t lose your changes).

    #59676
    Anonymous
    Inactive

    Thank you Franky!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top