• Resolved WebCodePoet

    (@senjoralfonso)


    The shortcode {salutation} is not working in emails (German formal) for me. Is there a way to fix this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @senjoralfonso

    We’re checking this issue right now and let you know if when we find the problem and fix it.

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Where do you want to use this {salutation} shortcode exactly? In “Subject”, “Email heading” and “Additional content” in your email settings for WooCommerce?

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Inside the text. I am using the Kadence Woocommerce E-Mail Designer Plugin by Kadence Themes to “style” the mails. I thought that I ever can edit the text, but it seems not possible by Woocommerce it self?

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @senjoralfonso

    We’ve checked “Kadence Woocommerce E-Mail Designer” but unfortunately we can’t support every plugin that has somethign to do with checkout fields. Nevertheless we looked into the code of the mentioned plugin and it seems there’s a way to add a new placeholder for the salutation to the main body text, but not to the subject. You can add the following code to the functions.php of your theme (if you have access to that):

    add_filter('kadence_woomail_order_body_text', function($body_text, $order, $sent_to_admin, $plain_text, $email) {
        return str_replace(
            '{customer_salutation}',
            \F4\WCSF\Core\Hooks::get_option_label(get_post_meta($order->get_id(), '_billing_salutation', true)), 
            $body_text
        );
    }, 10, 5);
    

    With this code added, you should have access to the placeholder {customer_salutation}. Watch out, the code above is not tested, but should work.

    We hope that this helps you. If you run in any error or problem, we’re happy to help you out.

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Wow, that was fast and and helpful, 5 Stars for that! But the code is not working at all. 🙁

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @senjoralfonso

    We installed the plugin to test the code above, and it seems wo work perfectly on our installation. The only thing thats not working is the preview in the backend, because we cant actually hook in this output unfortunatly. But the salutation should be displayed in the main text of the email perfectly. We’ve tested it for the “Customer Completed Order” mail and put the {customer_salutation} placeholder in the Body Text field. In which email did you try it? As above mentioned, it also only works in the “Body Text” field.

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Oh, thank you! Now it is working… I have forgotten to clear the REDIS caching.

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Perfectly, let me know if you need help with something else.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘{salutation} in Emails’ is closed to new replies.