Skip to content

Troubleshooting

  1. Go to WPify → WPify Woo
  2. Verify that the Vocative Case in Emails module is enabled
  3. Save changes

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

The module only works for emails related to orders. Other WooCommerce emails (e.g., password reset) are not affected.

// The module checks the object type
if ( ! is_a( $email->object, '\WC_Order' ) ) {
return $params; // Vocative is not applied
}

The inflection library may not correctly recognize all names, especially:

  • Foreign names
  • Unusual Czech names
  • Nicknames

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 );
}

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 );

If you are using custom text in the Replace first name field, make sure it contains placeholders:

Correct:

Ahoj {first_name},

Incorrect:

Ahoj zakazniku,

Other plugins may change email content. Check filter priorities:

// WPify Woo uses priority 20
add_filter( 'woocommerce_mail_callback_params', ..., 20 );
// 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' ) );
// Test name inflection
$inflection = new \WpifyWooDeps\Inflection();
$inflected = $inflection->inflect( 'Vaclav' );
// Index 5 = 5th case (vocative)
echo $inflected[5]; // "Vaclave"
add_filter( 'woocommerce_mail_callback_params', function( $params, $email ) {
error_log( 'Email params: ' . print_r( $params, true ) );
return $params;
}, 999, 2 );

The module requires WooCommerce 3.0+. Older versions may have a different email structure.

Some themes or plugins may override WooCommerce email templates. In such cases, the vocative may not be applied correctly.