For Developers
How the Module Works
Section titled “How the Module Works”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)Inflection Library
Section titled “Inflection Library”The module uses a PHP library for inflecting Czech names. It supports:
- Male names
- Female names
- Exceptions (e.g., names ending in “nis”)
Available Placeholders
Section titled “Available Placeholders”In the Replace first name setting, you can use:
| Tag | Description |
|---|---|
{first_name} | First name in vocative case |
{last_name} | Last name in vocative case |
{full_name} | Full name in vocative case |
Language Restriction
Section titled “Language Restriction”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.
Integration with WPML/Polylang
Section titled “Integration with WPML/Polylang”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.
Module Priority
Section titled “Module Priority”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.