This thread is resolved. Here is a description of the problem and solution.
Problem: You need to translate email strings into Estonian using the Kadence Email Customizer plugin while keeping placeholders like {invoice_pay_link} functional. Solution: We recommend adding specific code to the functions.php file of your child theme to handle the translation and functionality of placeholders. Here are the steps:
Add the following code to handle the translation and dynamic replacement of the {invoice_pay_link} placeholder:
If this solution does not resolve your issue or seems outdated, please check the related known issues and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket with us for further assistance.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am using the Kadence Email Customizer plugin to customize emails on my site under development. I need to translate some strings in these emails into Estonian. For example, the line 'An order has been created for you on {site_title}. {invoice_pay_link}' should be translated, where {site_title} is replaced by the site name and {invoice_pay_link} is replaced by a payment link with the caption 'Pay for this order'. I've written about this problem before (https://wpml.org/forums/topic/proble-with-kadence-email-customizer/), but there we solved it without translating texts via WPML, since the language on the site is the same.
Symptoms:
I need to translate email strings into Estonian using the Kadence Email Customizer plugin.
Questions:
How can I translate email strings into Estonian using WPML with the Kadence Email Customizer plugin?
At the same time, keeping tags, such as {invoice_pay_link} and other similar ones, functional. Now they are sent to the e-mail as a string. Here is an example:
"Teie jaoks on loodud tellimus saidil {site_title}. {invoice_pay_link}"
This is literally what I get in the email.
I am not sure if it covers the {site_title} also, so for this, can you try this as well? So after you check and confirm whether the above filter works, try this one:
add_filter('kadence_woomail_order_body_text', function($body_text, $order, $sent_to_admin, $plain_text, $email) {
// Check if WCML is active for translation support.
if (class_exists('WCML_Orders')) {
// Get necessary variables
$key = $email->id;
$btn_switch = Kadence_Woomail_Customizer::opt($key . '_btn_switch');
// Handle {invoice_pay_link}
$pay_link = "";
if ($order->get_checkout_payment_url()) {
if (true == $btn_switch) {
$pay_link = '<p class="btn-container"><a class="btn" href="' . esc_url($order->get_checkout_payment_url()) . '">' . esc_html__('Pay for this order', 'kadence-woocommerce-email-designer') . '</a></p>';
} else {
$pay_link = '<a href="' . esc_url($order->get_checkout_payment_url()) . '">' . esc_html__('Pay for this order', 'kadence-woocommerce-email-designer') . '</a>';
}
}
// Replace the placeholders {invoice_pay_link} and {site_title}
$body_text = str_replace('{invoice_pay_link}', $pay_link, $body_text);
$site_title = get_bloginfo('name');
$body_text = str_replace('{site_title}', esc_html($site_title), $body_text);
// Translate the body text via WPML
$order_language = $order->get_meta('wpml_language');
$body_text = apply_filters('wpml_translate_single_string', $body_text, 'admin_texts_kt_woomail', $key.'_body', $order_language);
}
return $body_text;
}, 20, 5);
Hello, now a slightly different problem, still related to Kadence and Woocommerce Subscriptions.
Some emails are not fully translated.
I have two languages on my site: Estonian and English. Estonian is set as default language. The lines in the emails are all translated.
But this is what I get if I subscribe in Estonian and try to renew it.
Email header (i.e. subject): “Your Luxador renewal order receipt from märts 24, 2025”
And in the e-mail itself, the English text at the beginning: “Your subscription renewal order has been received and is now being processed. Your order details are shown below for your reference:”
All other content is translated into Estonian correctly, except for “Credit card / debit card” in the payment method and the word “every” in the payment period.
Translated with DeepL.com (free version)
New threads created by Bruno Kos and linked to this one are listed below: