{"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

Pozorn\u00ed \u010dten\u00e1\u0159i jist\u011b zaregistrovali, \u017ee jm\u00e9no je nejprve posl\u00e1no do funkce osloven\u00ed, kter\u00e1 jej p\u0159evede na vokativ. V\u00edce najdete zde https:\/\/github.com\/honzaskypala\/osloveni<\/a>.<\/p>\n\n\n\n

V p\u0159\u00edpad\u011b, \u017ee pot\u0159ebujete upravit p\u0159edm\u011bt jin\u00e9ho e-mailu, mus\u00edte m\u00edsto customer_on_hold_order pou\u017e\u00edt id odpov\u00eddaj\u00edc\u00edho e-mailu.<\/p>\n","protected":false},"excerpt":{"rendered":"

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. 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. Vytvo\u0159\u00edme p\u0159edm\u011bt ve tvaru „Dobr\u00fd den {first_name}, va\u0161i objedn\u00e1vku jsme p\u0159ijali.“ Pozorn\u00ed \u010dten\u00e1\u0159i jist\u011b zaregistrovali, \u017ee jm\u00e9no je nejprve posl\u00e1no<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-6546","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6546"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=6546"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6546\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5600"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=6546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}