Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Sends an email to the review author when a new review is created.
- * Paste this in your active theme's functions.php file.
- *
- * @param \GeminiLabs\SiteReviews\Review $review
- * @return void
- */
- add_action('site-reviews/review/created', function ($review) {
- if (empty( $review->email)) {
- return;
- }
- // Change the subject and message as needed
- $subject = "Thank you for your review!";
- $message = "Thank you so much for your review! Here is what you submitted:\n\n".
- "Rating: {$review->rating}-stars\n".
- "Title: {$review->title}\n".
- "Review: {$review->content}";
- if (!wp_mail($review->email, $subject, $message)) {
- apply_filters('glsr_log', null, 'The notification to <'.$review->email.'> was not sent. Please verify that your server is able to send emails correctly through WordPress.');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement