Troubleshooting
Vocative Is Not Applied
Section titled “Vocative Is Not Applied”Module Is Not Active
Section titled “Module Is Not Active”- Go to WPify → WPify Woo
- Verify that the Vocative Case in Emails module is enabled
- Save changes
Language Restriction
Section titled “Language Restriction”If you have set Allowed Languages, the vocative is only applied for those languages.
Solution:
- Leave the field empty for all languages
- Or add the required language to the list
Email Is Not Order-Related
Section titled “Email Is Not Order-Related”The module only works for emails related to orders. Other WooCommerce emails (e.g., password reset) are not affected.
// The module checks the object typeif ( ! is_a( $email->object, '\WC_Order' ) ) { return $params; // Vocative is not applied}Incorrect Name Ending
Section titled “Incorrect Name Ending”Name Is Not Recognized
Section titled “Name Is Not Recognized”The inflection library may not correctly recognize all names, especially:
- Foreign names
- Unusual Czech names
- Nicknames
Special Cases
Section titled “Special Cases”The module contains an exception for names ending in “nis” (e.g., Yannis, Janis):
if ( preg_match( "/nis$/", $name ) ) { return preg_replace( "/nis$/", "nisi", $name );}Custom Rules
Section titled “Custom Rules”To add custom rules, use a filter with a lower priority:
add_filter( 'woocommerce_mail_callback_params', function( $params, $email ) { // Custom inflection before the module return $params;}, 10, 2 );Email Contains Original Text
Section titled “Email Contains Original Text”Text Change in Settings
Section titled “Text Change in Settings”If you are using custom text in the Replace first name field, make sure it contains placeholders:
Correct:
Ahoj {first_name},Incorrect:
Ahoj zakazniku,Conflict with Other Plugins
Section titled “Conflict with Other Plugins”Other plugins may change email content. Check filter priorities:
// WPify Woo uses priority 20add_filter( 'woocommerce_mail_callback_params', ..., 20 );Diagnostics
Section titled “Diagnostics”Checking Module Settings
Section titled “Checking Module Settings”// In debug code$vocative = wpify_woo_container()->get( \WpifyWoo\Modules\Vocative\VocativeModule::class);
var_dump( $vocative->get_setting( 'replace_first_name' ) );var_dump( $vocative->get_setting( 'allowed_languages' ) );Testing Inflection
Section titled “Testing Inflection”// Test name inflection$inflection = new \WpifyWooDeps\Inflection();$inflected = $inflection->inflect( 'Vaclav' );
// Index 5 = 5th case (vocative)echo $inflected[5]; // "Vaclave"Checking Email Before Sending
Section titled “Checking Email Before Sending”add_filter( 'woocommerce_mail_callback_params', function( $params, $email ) { error_log( 'Email params: ' . print_r( $params, true ) ); return $params;}, 999, 2 );Compatibility
Section titled “Compatibility”WooCommerce Version
Section titled “WooCommerce Version”The module requires WooCommerce 3.0+. Older versions may have a different email structure.
Themes and Plugins
Section titled “Themes and Plugins”Some themes or plugins may override WooCommerce email templates. In such cases, the vocative may not be applied correctly.