Developers
hooks, templates, data.
Reviewmend is plain PHP in the Reviewmend namespace. Extend it from your theme or a small plugin of your own with the hooks below, so updates never overwrite your changes.
01Actions
| Action | Arguments | Fires |
|---|---|---|
reviewmend_request_sent | int $invite_id, WC_Order $order | After a review request went out (not for reminders). |
reviewmend_submitted | int $invite_id, int[] $comment_ids, WC_Order $order | After a customer submitted the review page. $comment_ids are the product reviews created. |
reviewmend_case_opened | int $case_id | After a recovery case was opened and its alert e-mail handled. |
reviewmend_review_imported | int $comment_id, array $data | After the CSV import saved a review. $data is the checked row. |
reviewmend_admin_menu | Reviewmend\Admin\Menu $menu | While the Reviewmend menu is built. Call $menu->add_page( $slug, $page_title, $menu_title, $callback, $capability ) to add a screen before Settings; Reviewmend's admin CSS loads on it. Use a slug starting with reviewmend-. |
add_action( 'reviewmend_submitted', function ( $invite_id, $comment_ids, $order ) {
// For example: tag the order so your team sees it was reviewed.
$order->add_order_note( sprintf( 'Customer left %d review(s) through Reviewmend.', count( $comment_ids ) ) );
}, 10, 3 );
There is also an internal action, reviewmend_display_pre_get_comments, used by the product page display for WooCommerce's review blocks. It is not meant for extensions.
02Filters
| Filter | Value | Use |
|---|---|---|
reviewmend_consent_label | string $label | Text of the checkout consent checkbox, on both checkouts. |
reviewmend_system_checks | array $checks | Add rows to the System check. Each row: id, label, status (ok, warning, error, info), message, fix_url. |
add_filter( 'reviewmend_consent_label', function () {
return 'Yes, e-mail me once to ask for a review';
} );
add_filter( 'reviewmend_system_checks', function ( $checks ) {
$checks[] = array(
'id' => 'my_smtp',
'label' => 'SMTP plugin',
'status' => is_plugin_active( 'my-smtp/my-smtp.php' ) ? 'ok' : 'warning',
'message' => 'Review requests are sent through SMTP.',
'fix_url' => '',
);
return $checks;
} );
The e-mails are normal WooCommerce e-mails, so WooCommerce's own filters work too, for example woocommerce_email_recipient_reviewmend_case_alert to add a second recipient to the case alert. E-mail IDs: reviewmend_review_request, reviewmend_review_reminder, reviewmend_case_alert, reviewmend_case_reply, reviewmend_monthly_report.
03E-mail template overrides
Copy a template from the plugin into your theme and edit the copy. WooCommerce loads your copy instead; updates of Reviewmend do not touch it.
| Plugin file | Copy to | Used by |
|---|---|---|
templates/emails/reviewmend-review-request.php | yourtheme/woocommerce/emails/reviewmend-review-request.php | Review request and Review reminder ($is_reminder tells them apart) |
templates/emails/reviewmend-case-alert.php | yourtheme/woocommerce/emails/reviewmend-case-alert.php | Recovery case opened |
templates/emails/reviewmend-case-reply.php | yourtheme/woocommerce/emails/reviewmend-case-reply.php | Recovery case reply |
templates/emails/reviewmend-monthly-report.php | yourtheme/woocommerce/emails/reviewmend-monthly-report.php | Monthly report |
Plain-text versions are in templates/emails/plain/ and go to yourtheme/woocommerce/emails/plain/. Use a child theme, so a theme update does not remove your copies. Variables available in each template are listed in the comment at its top. Keep the star links and the unsubscribe link in the request template.
The review page, the product page summary and the wall have no PHP template overrides; change their look with CSS (classes start with reviewmend).
04Data reference
| Item | Name |
|---|---|
| Tables | {prefix}reviewmend_invites, _cases, _case_events, _unsubscribes |
| Options | reviewmend_settings, reviewmend_secret, reviewmend_page_id, reviewmend_db_version, reviewmend_installed_at, reviewmend_import_job |
| Review comment meta | rating, verified (WooCommerce), reviewmend_invite, reviewmend_reason, reviewmend_photos (attachment IDs), reviewmend_incentivized, reviewmend_imported |
| Order meta | _reviewmend_consent (yes/no) |
| Coupon meta | _reviewmend_invite |
| Shortcodes | [reviewmend_review] (review page), [reviewmend_wall] |
| Block | reviewmend/wall |
| Capability | reviewmend_manage_cases (recovery desk); everything else uses manage_woocommerce |
| Action Scheduler | group reviewmend; hooks reviewmend_dispatch (every 5 minutes), reviewmend_dispatch_more, reviewmend_monthly_report, reviewmend_import_batch |
Read settings in code with \Reviewmend\Settings::get( 'delay_days' ); keys are the ones in Settings::defaults().