Unless for some reason you need this to be hardcoded into your theme or have full control over your own plugin, you could use the existing Peter’s Collaboration Emails plugin.
If installing a plugin is not an option, I’d suggest modifying the above or borrowing some of its code, respectively. It can do all the things you require.
As an aside, it’s also easily adapted to work with just one or several custom post type(s).
Related Posts:
- How can I format email notification after registration?
- Conditional wp_mail statement on post
- Does WordPress have a built in message function for presenting notifications to users?
- Remove Update Notification (for all users except ADMIN)
- Show Admin Message on Redirect
- If new comment posted in custom post – send notification to custom email from custom field
- How to send notifications without a plugin when a post is updated in WordPress?
- Email has been changed notifications
- How best to display notifications on the front-end using caught exceptions as an example
- Send notification to the admin when new custom post is submitted
- What are the pros and cons to a WordPress run newsletter v. third party newsletter? [closed]
- REST alert when new WordPress post is published or updated
- What is the most efficient way of implementing a notification system? [closed]
- Can I show a custom message to a specific user?
- send new post notification to an email address stored in a custom field value
- Removing sensitive information from comment notifications – notify_post_author
- Notification when certain posts are published
- How to display Real-Time notifications (via Icons) in WordPress
- How to send automatic response after form submission without plugin
- WordPress, Mailchimp, Campaigns – should separate campaigns be used for something like notifying users of drip content?
- How can admins to be notified of changes when users change their WP profiles?
- New user notification issue
- Notification on getting an email from an user
- How to prevent comment moderation flood?
- Looking for plugins that notify users of comment replies [closed]
- What is the advantage of using wp_mail?
- Disable email notification after change of password
- How to disable the “Your site has updated to WordPress x.y.z” admin email?
- Disable new user notification to admin email
- Send attachments via wp_mail from temporary folder
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Fatal error: Call to undefined function wp_mail()
- Mail will not send in HTML
- Notify admin when page is edited?
- How can I edit the email sent when a new comment is received?
- How to notify users of blog updates a la Admin Plugin Update notifications?
- wp_mail recipient array not sending?
- Change Default wp_mail From, Without Affecting Gravity Forms
- An old plugin self-made stoped sending mail
- Problem with `wp_mail()`
- Should I use wp_mail or PHP’s mail? [duplicate]
- How do I call wp_mail from HTML?
- How to create a CSV on the fly and send as an attachment using wp_mail?
- Disable WP notifications for commenting on own posts
- Must I change the admin user email address while changing the general email address?
- Best way to notify WordPress plugin users of new release candidates for beta testing?
- admin_notices not displaying in plugin
- Notification to Admin or Author upon new post [duplicate]
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- Getting admin notices working for plugin errors
- Tag subscription option in wordpress. How?
- Mechanism to send to users of secured WordPress install new notifications by SMS or email?
- WP mail sent to MS Exchange recipients = occasional email corruption?
- WordPress ajax success response
- Notify admin on new submit
- Howto disable comment moderation emails for admins, but not for authors
- Facebook-like Notification Plugin for WordPress Community Blog Sites?
- contact form ajax empty response error message
- wp_mail() inside AJAX handler never returns
- Website needs to be opened for wp_mail to work
- wp_mail not sending emails
- What is the best way to send out thousands of emails from a WordPress site? [closed]
- If/elseif statement within wp_mail function
- Help with filter for wp_notify_moderator()
- How to disable wp_mail for all users except for admins?
- Pass return-path additional parameter in wp_mail
- Different SMTP based on domain
- Create a notification for post field
- Send Weekly Email if Users have not complete their profiles
- Is there a way getting post fields using `transition_post_status`
- How to display image in mail header using wp_mail()
- Condition within single.php to send an email to the post author
- Could not get attachment using wp_mail
- How to send a BuddyPress user a notification on a plugin event? [closed]
- How to customize maintenance mode notification in wordpress?
- How to disable activation email to specific user role?
- Using wp_mail to send email?
- Using SMTP Function instead of Plugin (functions.php)
- WordPress woocommerce new order email not working
- Updated : how to make email optional while user registration using default wordpress form
- How to send a particular csv file as an email?
- Email post to submitter
- Send data URL string as an attachment in wp_email
- WP_mail() Issue. Duplicate emails if $_GET[‘A’] == email
- How to use Contact Form 7 to handle the server side mail() only?
- Check if “Send the new user an email about their account” is ticked
- How to send email with wp_mail() with from email taken from contact form instead of the host?
- Wp_mail doesnt work
- Displaying errors on the front end from my plugin
- Which hook to use to add notification message at beginning of my
- Custom Contact Form Not Sending (but not giving error)
- User profile update author
- Subscribe to a post’s comments without posting a comment yourself
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- How to show value from ACF plugin field in e-mail?
- Notifications Bar on home page only
- WordPress is not sending the 2nd email in the same request
- How to send push notification in android using php? [closed]
- wp_mail vs mail functions and header arrays
- Call API on post save/update and show the result in admin area