Events Made Easy › Forums › How do I … › Send email to Admin when draft event is submitted
Tagged: drafts, email, front-end, notification
- This topic has 7 replies, 2 voices, and was last updated 5 years, 10 months ago by Anonymous.
-
AuthorPosts
-
Fri 22 Feb 2019 at 12:18 #59663AnonymousInactive
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
Fri 22 Feb 2019 at 12:24 #59664AnonymousInactiveI looked in 12 – Hooks and filters and could not find the answer.
Fri 22 Feb 2019 at 13:14 #59666FrankyKeymasterLook again, see the hook “eme_insert_event_action”
Fri 22 Feb 2019 at 13:51 #59668AnonymousInactiveHow 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.
Fri 22 Feb 2019 at 15:02 #59669FrankyKeymasterIF 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.Sat 23 Feb 2019 at 06:44 #59674AnonymousInactiveSadly, 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.
Sat 23 Feb 2019 at 09:16 #59675FrankyKeymasterSee 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).Sat 23 Feb 2019 at 11:43 #59676AnonymousInactiveThank you Franky!
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.