Reviewmend docs
v1.0.0
Get help
● Reference · Hooks and templates

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.

7 reviewmend_* hooks4 e-mail templatesNo build step

01Actions

ActionArgumentsFires
reviewmend_request_sentint $invite_id, WC_Order $orderAfter a review request went out (not for reminders).
reviewmend_submittedint $invite_id, int[] $comment_ids, WC_Order $orderAfter a customer submitted the review page. $comment_ids are the product reviews created.
reviewmend_case_openedint $case_idAfter a recovery case was opened and its alert e-mail handled.
reviewmend_review_importedint $comment_id, array $dataAfter the CSV import saved a review. $data is the checked row.
reviewmend_admin_menuReviewmend\Admin\Menu $menuWhile 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

FilterValueUse
reviewmend_consent_labelstring $labelText of the checkout consent checkbox, on both checkouts.
reviewmend_system_checksarray $checksAdd 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 fileCopy toUsed by
templates/emails/reviewmend-review-request.phpyourtheme/woocommerce/emails/reviewmend-review-request.phpReview request and Review reminder ($is_reminder tells them apart)
templates/emails/reviewmend-case-alert.phpyourtheme/woocommerce/emails/reviewmend-case-alert.phpRecovery case opened
templates/emails/reviewmend-case-reply.phpyourtheme/woocommerce/emails/reviewmend-case-reply.phpRecovery case reply
templates/emails/reviewmend-monthly-report.phpyourtheme/woocommerce/emails/reviewmend-monthly-report.phpMonthly 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

ItemName
Tables{prefix}reviewmend_invites, _cases, _case_events, _unsubscribes
Optionsreviewmend_settings, reviewmend_secret, reviewmend_page_id, reviewmend_db_version, reviewmend_installed_at, reviewmend_import_job
Review comment metarating, 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]
Blockreviewmend/wall
Capabilityreviewmend_manage_cases (recovery desk); everything else uses manage_woocommerce
Action Schedulergroup 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().