Sending email notifications upon new submissions
Just like WordPress sends out email notifications to the administrator when new comments are posted, it can be very useful to send out emails when visitors post new book reviews. This allows website managers to review new content as it comes in and decide whether they approve it to be published online.
Getting ready
You should be running the final version of the Book Reviews plugin created in Chapter 4, The Power of Custom Post Types, and should have already followed the Saving user-submitted data in custom post types recipe (including changing the post status to draft
as indicated in the There's more... section). Alternatively, you can get the resulting files from the book's GitHub page (ch4/ch4-book-reviews/ch4-book-reviews-v12.php
and ch7/ch7-book-review-user-submission/ch7-book-review-user-submission-v2.php
) and rename ch7-book-review-user-submission-v2.php
to ch7-book-review-user-submission.php
. Finally, you should...