email-notifications

Send custom notification In Woocommerce edit order pages repetition issue

自闭症网瘾萝莉.ら 提交于 2019-12-07 11:36:25
I created "email notifier for order tracking" plugin for woocommerce. All works fine and when I save tracking number, it sends an email to customer. But when I save another field in order page, it sends email again. How can I fix it? add_action('add_meta_boxes', 'kargo_takip'); function kargo_takip() { add_meta_box('kargo_takip_meta_box', 'Kargo Takip', 'kargo_takip_meta_box_ekle', 'shop_order', 'side', 'high'); } function kargo_takip_meta_box_ekle() { global $post; $meta_field_data = get_post_meta($post->ID, '_kargo_takip', true) ? get_post_meta($post->ID, '_kargo_takip', true) : ''; echo '

Custom Email is not sending on Order complete in WooCommerce

我的梦境 提交于 2019-12-07 08:42:52
问题 I am facing a problem to send a custom email in WooCommerce. Here is Error: Fatal error: Cannot use object of type WC_Order as array in /home/wp-content/themes/structure/functions.php on line 548 My client want to send a custom email when everytime customer order and pay, besides the standard order confirmation email. Here is my code: $order = new WC_Order( $order_id ); function order_completed( $order_id ) { $order = new WC_Order( $order_id ); $to_email = $order["billing_address"]; $headers

Customize formatted billing full name with a custom field in Woocommerce emails

强颜欢笑 提交于 2019-12-07 08:34:25
On one of my websites I use the Flexible Checkout Fields for WooCommerce to make 20 custom fields. Two of them needed to be a select/dropdown field. I wasn't able to do so via the plugin (didn't want to pay for it. Regret that decision now. It is horrible); so I used the first-name and last-name default tags from WooCommerce to make them into a select field. I use them to select the Mr/Mrs title before the name. The emails now only show the first-name and last-name fields, as where I would like to have the first-name (Mr/Mrs title select) and my new custom field for the first name. I found the

Change sender name and email address for specific WooCommerce email notifications

て烟熏妆下的殇ゞ 提交于 2019-12-07 04:44:29
问题 How to change email sender address and name in WooCommerce for specific email notifications? For example: Change the sender name and email address just for customer processing order email notifications. But not for all email notifications, just for specific ones. 回答1: The sender name and email address are set here (at the end of Woocommerce "Emails" setting tab: This fields are passed through dedicated filters hook that allow you to change conditionally the values. Here is an example

Send Woocommerce Order to email address listed on product page

非 Y 不嫁゛ 提交于 2019-12-06 16:47:10
I'm using Woocommerce and the Product Addons plugin to add extra fields to a product. One of those fields is an email address to let people send the confirmation of the order to a DIFFERENT address than the billing address shown on the checkout page. Emails should be sent to both addresses. Any thoughts on maybe how to modify the functions.php file to do this? In the woocommerce_email_recipient_{$this->id} filter hook, you can use the $order argument to get your 2nd email. But first Lets add globally an email field with the Product Add-ons plugin… The add on field on the product (fill the

Set a Tracking Number link on customer email notifications in Woocommerce 3

折月煮酒 提交于 2019-12-06 16:13:58
I've managed to get this together and now I'm trying to make the number that is being entered into the custom field (saved to the order) to be linked in the order email. Here's the code: // create the metabox add_action( 'add_meta_boxes', 'bdev_add_postnord_meta_box' ); if ( ! function_exists( 'bdev_add_postnord_meta_box' ) ) { function bdev_add_postnord_meta_box() { add_meta_box( 'postnord_field', __('PostNord Parcel ID','woocommerce'), 'bdev_add_postnord_for_tracking', 'shop_order', 'side', 'core' ); } } if ( ! function_exists( 'bdev_add_postnord_for_tracking' ) ) { function bdev_add

Add account email conditionally on Customer processing Order email notification in Woocommerce

此生再无相见时 提交于 2019-12-06 14:55:46
So this is more of my solution here but I wanted to open this up to see if the community could find a better alternative or potentially find use for this solve. Our client asked us for the following alteration to the email order receipts received on order creation: The receipts should go to the account holder and cc the billing email if it's different As we know Woocommerce by default sends the order receipt (Customer Processing) based on only the set billing_email on checkout so I started to look for a way to add on the tack on the account owner email to it as well. I did some digging and

Add the product description to WooCommerce email notifications

╄→гoц情女王★ 提交于 2019-12-06 13:43:55
How to add product description/content of single product page (not the short description) to WooCommerce new order email notification? I need to know specific written description of my products as most of them are almost same. As you are targeting a specific email notification, first we need to get the Email ID to target the "New Order" email notification. The only way is to get it before and to set the value in a global variable. Then in a custom function hooked in woocommerce_order_item_meta_end action hook, we display the product description exclusively for New Order email notification.

Display order customer note in Woocommerce email notifications

僤鯓⒐⒋嵵緔 提交于 2019-12-06 12:55:18
In Woocommerce, I am trying to get the customers additional order message: I am trying to display that customer message on the email notifications. But i don't know how to get this information in the php code. Here is my code in the functions.php file: add_action( 'woocommerce_email_after_order_table', 'ts_email_after_order_table', 10, 4 ); function ts_email_after_order_table( $item_id, $item, $order, $plain_text){ $notes=$order->customer_message; //did not work echo '<table cellspacing="0" cellpadding="0" style="width: 100%; color: #636363; border: 1px solid #e5e5e5;" border="0"><tbody><tr>

Send a custom email when WooCommerce checkout button is pressed

混江龙づ霸主 提交于 2019-12-06 12:47:47
问题 I am trying to send a custom email whenever the checkout button is pressed for Woocommerce using PHP. This email will be sent alongside with the email notifications of wooCommerce. I have used this answer, and edited the code like: //execute some php on successfull checkout add_action( 'woocommerce_payment_complete', 'so_32512552_payment_complete' ); function so_32512552_payment_complete( $order_id ){ $order = wc_get_order( $order_id ); foreach ( $order->get_items() as $item ) { if ( $item[