Skip to content

For Developers

The module intercepts WooCommerce emails using the woocommerce_mail_callback_params filter and automatically converts the first name to the 5th grammatical case (vocative) in the greeting.

The vocative case is used in Czech (and some other Slavic languages) when directly addressing a person. Names change their form - for example, “Vaclav” becomes “Vaclave” in direct address. This provides grammatically correct and natural-sounding customer greetings.

// Original: "Ahoj Vaclav," (grammatically incorrect in Czech)
// After modification: "Ahoj Vaclave," (automatically inflected, correct form)

The module uses a PHP library for inflecting Czech names. It supports:

  • Male names
  • Female names
  • Exceptions (e.g., names ending in “nis”)

In the Replace first name setting, you can use:

TagDescription
{first_name}First name in vocative case
{last_name}Last name in vocative case
{full_name}Full name in vocative case

The module supports restriction to specific languages using the allowed_languages setting. This is useful for multilingual websites where vocative should only be applied for Czech language emails.

The module automatically respects the current language. The vocative transformation is only applied when the email language matches the allowed languages configured in the module settings.

The module uses priority 20 on the woocommerce_mail_callback_params filter. If you need to modify the email content before or after the vocative transformation, you can use a lower or higher priority respectively.