It’s quite simple, just hook a function on comment_post
in which you check if the comment is a reply and send the author of the parent comment an email:
add_action('comment_post', 'notify_author_of_reply', 10, 2);
function notify_author_of_reply($comment_id, $approved){
if($approved){
$comment = get_comment($comment_id);
if($comment->comment_parent){
$parent_comment = get_comment($comment->comment_parent);
wp_mail($parent_comment->comment_author_email, 'Hello', 'Dude you got a reply...');
}
}
}
For handling unsubscriptions, you can add store emails of people who don’t want notifications inside an option (and check if $parent_comment->comment_author_email
is not within that list in the function above).
Related Posts:
- How to change the email notification recipient (user) for new comments?
- How can I edit the email sent when a new comment is received?
- Multiple Comment Moderators and Notifications
- Plugin from WordPress.com for comment notification…available? [closed]
- If new comment posted in custom post – send notification to custom email from custom field
- Disable Admin account being emailed for comment notification
- WordPress comments email notification for authors
- Send Notifications to All Admins
- Email notification to an email address other than admin for custom type post comments in wordpress
- Notify post author for a new comment on his post?
- Reply By Email to comment notifications
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Sending comment notifications to different recipients depending on taxonomy terms
- Not receiving any e-mails after new comment
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Comment notification not working
- Subscribe to a post’s comments without posting a comment yourself
- Customize the new comment notifications sent to the post author after the comment is approved
- R: Comment out block of code
- How to rearrange fields in comment_form()
- Commenting in user profile page?
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- How to load and show comments with AJAX instead of pagination?
- Comments not appearing at all
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Disabling Comment Notifications for Post Author
- Comment Count for each Comment Author
- Show comments from multiple post IDs in comment template
- Hook/Filter before and after comments
- Comment form validation
- Sticky Comments
- Comments number message in password protected post
- Disable Comments Feed
- Use rich text editor in comments?
- I have tried using Plugins to remove 72K comments with no success
- Show only posts which can be commented
- show un-approved comments at wordpress front end
- How to add pagination to comments?
- Report spam button
- Recent comments from my blogs only
- show if comment is in moderation
- Disable or Enable Comments on Front end [closed]
- Reject Comments Based on Author Email
- Turning off trackbacks & comments
- Disqus comments and pingback script – how to change the order?
- Comment Moderation and CDN Caching
- Delete all one-word comments
- Is it possible to embed github gists in wordpress comments?
- Comments feed – Undefined named entity: ndash
- The “\” is missing when comments is updated
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- Why do I have to manually approve comments from one of my users who already has an approved comment?
- Notify comment author upon reply
- How to convert WordPress comments to bbPress replies [closed]
- Get declared variable in single.php to work in comments.php without re-declaring it [closed]
- What is causing wp-comments-post.php to redirect to the browser’s IP address?
- comments_number not displaying
- Get comments only for certain specific users in template file
- How to direct user after comment save
- Show comment pop up links as text only
- Insert Ads “into” comments section in Genesis Themework
- Displaying comments on pages distinguished by GET IDs
- How to get comment images stored as serialized comment meta
- Update comment meta for all comments of specific post
- How to permanently delete pages I have already trashed?
- Additional content every x comments
- How to display category name from commenter’s custom post
- How to change comment texts that has a specific comment_ID – Hook into comment
- Adding comments section to website integrated WordPress instance
- How to Define Custom Number of Items in Comment Feed
- What’s the difference with trash_comment and wp_trash_comment?
- How can i change the order of comments?
- Empty comments field or
- infinite loop on page with comments after changing comments.php and header.php
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- Default Gravatar not showing for pings
- How include comment and post count of user in this custom query
- Refresh individual comment text via API
- How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?
- Disallow Comments
- Need to output comment_form() function inside a foreach loop
- Comment field override
-   not working in comments
- Badges for Guests based on their comment counts [closed]
- Comment section not appearing on posts
- Where is the Leave a Comment link set
- Disable comment moderation in multisite
- URLs to user page is broken
- Comments Template shows, but not the comments
- Auto disable comments with custom field
- delete user not working
- Force logged in users to provide more data when commenting
- How do I get the comments section to show up?
- By Default, Turn Comments Off for Pages & Leave Comments On for Posts
- How to remove or customize “Comment” in comments form?
- Getting thousands of spam comments
- check if a comment was made by a registered user
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Get approved comments or comments that the author is me