-
-
Save Apina/ee4cb6913a44813c2c10 to your computer and use it in GitHub Desktop.
EE3 R+P - send email to site admin when new event has been created - very basic, doesn't exclude admin etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this is a very basic example and should be used as a basis rather than as is. | |
// It is not supported by Event Espresso nor will it likely be updated. | |
function myemailthing($_REQUEST) { | |
//var_dump($_REQUEST); | |
//wp_die( ); | |
$admin_email = get_option( 'admin_email' ); | |
$user = get_user_by( 'id', $_REQUEST['user']); | |
$subject = 'New event added'; | |
$message = 'A new event called ' . $_REQUEST['event'] . ' has been created by ' . $user->first_name; | |
wp_mail( $admin_email, $subject, $message ); | |
} | |
add_action('action_hook_espresso_insert_event_success','myemailthing'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment