Contact Notification Emails Not Send After Comment Approval in WordPress

hi
when some one post in my blog, i (admin) get reply that some one posted, but when i approved that or reply on that, the poster dont get any notifications

so how will i be able to let poster know that there is a reply on his post ??

thanks
LVL 29
fosiul01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KysolCommented:
Personally I have no clue if it does send upon approval by default. If it doesn't you can use a hook:

wp_set_comment_status 
Runs when the status of a comment changes. Action function arguments: comment ID, status string indicating the new status ("delete", "approve", "spam", "hold").

add_action()

hope that helps.
0
fosiul01Author Commented:
do i have to add that code in wp_set_comment_status ??



another thing

like from word press admin section,

when i click on users post , there is a section call "Reply"

i thought, if i click on Reply, it will go to users inbox directly, but its does not, when i click on Reply and submit

its actually put my comments in the webstie rather then emailing to the users


so i want that as well..but dont know how

0
KysolCommented:
No you would have to write a plugin to fire off the add_action. I'll look into it now.
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

fosiul01Author Commented:
0
KysolCommented:
The code snippet is a very simple piece, there's no validation and so on, but it's a proof of concept that works and you can build on it.

I wouldn't advise to use it outside of a development environment until you are 100% sure that all data has been sanitized. This is just an example to get you on the right track.
<?php
/*
Plugin Name: Comment Notification
Version: 1.0
Description: Adds Notification to Comments
Author: Kysol
*/

	/* Plugin Code */
		function comment_status_change( $id, $status )
		{
			if ( $status == 'approve' )
			{
				$comment = get_comment( $id );

				if ( $comment->comment_author_email )
				{
					wp_mail(
						$comment->comment_author_email,
						get_bloginfo( 'name' ) . ' - Comment Approved',
						'Your comment: "' . $comment->comment_content . '" has been approved.',
						''
					);
				}
			}

			return $id;
		}

	/* Wordpress Hooks */
		add_action( 'wp_set_comment_status',	'comment_status_change', 100, 2 );
?>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fosiul01Author Commented:
i am not in php for long time!!!

so it would be hard for me pick things up ..

have you look at this link

http://wordpress.org/extend/plugins/comment-reply-notification/installation/

any idea why thsi one is not sending email ???
0
fosiul01Author Commented:
or even is there any other plugin i can use to do my task ??
0
fosiul01Author Commented:
i found another plugin "mail to commenter"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.