{"id":6546,"date":"2021-12-22T20:32:24","date_gmt":"2021-12-22T20:32:24","guid":{"rendered":"https:\/\/musilda.cz\/?p=6546"},"modified":"2021-12-22T20:32:24","modified_gmt":"2021-12-22T20:32:24","slug":"pridani-jmena-do-predmetu-e-mailu-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/pridani-jmena-do-predmetu-e-mailu-woocommerce\/","title":{"rendered":"P\u0159id\u00e1n\u00ed jm\u00e9na do p\u0159edm\u011btu e-mailu WooCommerce"},"content":{"rendered":"\n
P\u0159edm\u011bt e-mailu je mo\u017en\u00e9 nastavit u ka\u017ed\u00e9ho e-mailu v administraci. V p\u0159\u00edpad\u011b, \u017ee pot\u0159ebujeme s p\u0159edm\u011btem pracovat dynamicky, mus\u00edme vyu\u017e\u00edt filtru.<\/p>\n\n\n\n
Proto\u017ee m\u00e1 WooCommerce dynamick\u00fd filter woocommerce_email_subject_{id_emailu}, tak pomoc\u00ed zm\u011bn\u00edme p\u0159edm\u011bt e-mailu, jak budeme pot\u0159ebovat. <\/p>\n\n\n\n
Vytvo\u0159\u00edme p\u0159edm\u011bt ve tvaru „Dobr\u00fd den {first_name}, va\u0161i objedn\u00e1vku jsme p\u0159ijali.“<\/p>\n\n\n\n
add_action( 'woocommerce_email_subject_customer_on_hold_order', 'musilda_custom_subject', 10, 2 );\nfunction musilda_custom_subject( $subject, $order ) {\n\n\t\/\/Use this function https:\/\/github.com\/honzaskypala\/osloveni\/blob\/master\/php\/osloveni.php\n\n\t$subject = 'Dobr\u00fd den ' . osloveni( $order->get_billing_first_name() ) . ', va\u0161i objedn\u00e1vku jsme p\u0159ijali.';\n\n\treturn $subject;\n\n}<\/code><\/pre>\n\n\n\n