Created
November 7, 2023 09:02
-
-
Save dytra/4ca99cd158ed543a3607f4bf8ba98773 to your computer and use it in GitHub Desktop.
wordpress plugin extension that injects to recipe_rated hook
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 | |
/* | |
Plugin Name: Udemy Plus Emailer | |
*/ | |
add_action('recipe_rated',function($data) { | |
$post = get_post($data['postID']); | |
$authorEmail = get_the_author_meta('user_email', $post->post_author); | |
$subject= "Your recipe has received a new rating"; | |
$message="Your recipe {$post->post_title} has received a rating of {$data['rating']}"; | |
wp_mail($authorEmail, $subject,$message); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment