• Resolved WebCodePoet

    (@senjoralfonso)


    Hello,

    you made this wonderful snippet for me

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

    unfortunately it is not working anymore, maybe Kadence changed something in their plugin…

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

    (@faktorvier)

    Hi @senjoralfonso

    I think the Kadence plugin changed something. Maybe the placeholder {customer_salutation} has changed. You could try to add a debug hook to see if the placeholder is still there but with another name:

    add_filter('kadence_woomail_order_body_text', function($body_text, $order, $sent_to_admin, $plain_text, $email) {
        var_dump($body_text);
        return $body_text;
    }, 10, 5);

    So you should see the body text and if the placeholder is still there. Maybe you just have to change {customer_salutation} to something else.

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Hi, thank you so far, it puts out the {customer_salutation} shortcut as {customer_salutation}, but did not change it in the email, so that the customer receives a email that starts with “Hello {customer_salutation} Name,” I can’t the any changes after trying your test snippet, the behavior is the same, but it now shows: string(152) “Hallo {customer_salutation} Name”

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @senjoralfonso

    I just tested this on our system and the hook still works. I’ve testet it with the “Customer Completed Order” mail. We’re using the current versions of WooCommerce and both plugins. Maybe there’s something wrong with your installation? Did you change something?

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Mh, I just installed the updates, maybe an other plugin overwrites the snippet?

    Plugin Author FAKTOR VIER

    (@faktorvier)

    That may be, but if you could use the debug-snippet from above, then the hook seems to work.

    You could try the following:

    1. Change te priority of the hook (change the 10 to something higher like 99)
    2. Check if the hook is defined gobally and not depending on another hook that may not be executed every time
    3. Try a static replace (replace the \F4\WCSF\Core\Hooks::get_option_label(get_post_meta($order->get_id(), '_billing_salutation', true)) with a static string like “Herr” and check if its still not outputted correctly

    If those things not work then maybe you should ask the Kadence plugin developers if they have an idea.

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Hi, I tried first to add the 99, than to add “Herr”. it looks like the replacement is not working.

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Well, I’m out of ideas. Its strange, because its working perfectly on our installations. If the placeholder is correctly and contains no typo, it HAS to work. Except the hook is not working in the email or something that comes after that hook overwrites the already replaced text. Maybe the Kadence plugin developers have an idea?

    Thread Starter WebCodePoet

    (@senjoralfonso)

    Hi, I now have installed a new theme, and it now just works perfect. I do not know where exactly the old theme crashed the emails, but I am happy now!

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Glad that it works and you’re happy now!

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

The topic ‘Kadence E-Mail Designer’ is closed to new replies.