Admin does not receive email notification after review is submitted

Hello again

As you can see I am testing the app thoroughly before releasing it, sorry for harassing you.

As stated in the title : I (as admin) don’t get notified by email when a new review is posted.
Yes, the red dot is there in the back office, showing that a comment awaits to be moderated :
image

as set up in the reviews section of HivePress > Settings :

But I don’t get the email.

Just in case, I also checked my Settings > discussion section :
image

I should also mention I get notifications from new listings, new requests, new registrations though.

:thinking:

To follow up :

So far I am using fake accounts (and fake emails) to test out the website.

They do receive notifications regarding their reviews (to and from) :
image

I, as admin, don’t.

Hi,

Yes, there are no such emails for admins yet, as the review emails were released in the latest version, but we plan to add them in future updates. As a workaround, we can provide you with PHP snippets to add such an email. Let me know if this works for you.

Hello @andrii

Of course I am interested in a workaround.

Cheers,

Please try using the hivepress/v1/models/review/create hook Action: hivepress/v1/models/{model_name}/{action_type} | HivePress Hook Reference If you add a callback function to this hook you can then send an email to the site admin email address using wp_mail() – Function | Developer.WordPress.org The admin email address can be fetched via get_option('admin_email')

Hope this helps

Hello @ihor,

Tried this :

add_action('hivepress/v1/models/review/create', function($email){
  	wp_mail(get_option('admin_email'), 'A review needs to be approved', $email->get_body());
	}
);

No luck.

Please check if the function is called at all using error_log, you can also check the PHP error logs - this hook passes the $review_id instead of $email so there may be a PHP error when $email->get_body() is called.

Updated snippet works :

add_action('hivepress/v1/models/review/create', function($email){
	error_log($email);
  	wp_mail(get_option('admin_email'), 'A review needs to be approved', 'blank content');
	}
);

Actually I don’t need to know the content of the review, as it needs to be moderated. All I wished was to be notified, as for other entities (new user registration, request, listings…).

And yes, the error_log just returns a number, matching the review ID.

Kudos @ihor !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.