email-notifications

Woocommerce email notification recipient conditionally based on custom field

久未见 提交于 2019-12-04 18:11:37
I have a checkout form with a custom field. I would like to add an extra recipient to an order email based on the value in the custom field. The custom field is currently a drop down menu with only 3 options. Below is the code I was able to piece together with some googling however this does not appear to work. function sv_conditional_email_recipient( $recipient, $order ) { $custom_field = get_post_meta($orderid, 'custom_field', true); if ($custom_field == "Value 1") { $recipient .= ', email1@gmail.com'; } elseif ($custom_field == "Value 2") { $recipient .= ', email2@gmail.com'; } elseif (

Send cancelled and failed order email to customer in Woocommerce 3

落花浮王杯 提交于 2019-12-04 16:19:25
I need to send cancelled and failed order email to customers in Woocommerce 3.4+ . I'm constantly getting Fatal error: Uncaught Error: Call to a member function get_billing_email() on null in I've tried few function (like below) from stackoverflow with same result: function wc_cancelled_order_add_customer_email( $recipient, $order ) { return $recipient .= "," . $order->get_billing_email(); } add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 ); add_filter( 'woocommerce_email_recipient_failed_order', 'wc_cancelled_order_add_customer_email',

Get the customer user_id in Woocommerce email footer template

感情迁移 提交于 2019-12-04 16:04:12
I am trying to get current_user_id in woocommerce custom email template but it returns 0. Does anyone know how to get user_id in email template in wordpress. I get the user id when I use this code in any php template. Below is my code: <?php global $current_user; get_currentuserinfo(); echo '<h4>Your code:</h3>' . $current_user->ID . ''; ?> Here is complete template code link: email-template-code You can't get the current user in woocommerce email templates, but you can get the customer user ID from the Order. To get the customer User ID, you can set and get some data in the $GLOBAL variable:

Add a custom placeholder to email subject in WooCommerce

一曲冷凌霜 提交于 2019-12-04 15:59:51
I have a Woocommerce shop and I wanted to add a delivery_date after I accept the payment. I create a custom field in the order section named delivery_date with a date value. Now I wanted to use this custom field as a placeholder in email notification subject, like: Your order is now {order_status}. Order details are shown below for your reference: deliverydate: {delivery_date} I think the placeholder don't work like this, I need to change something in the php but I don't know where. To add a custom active placeholder {delivery_date} in woocommerce email subject, you will use the following

WooCommerce Cancelled email notification Not sent when Order expires

試著忘記壹切 提交于 2019-12-04 12:43:43
I have set up the stock in the woocommerce and configure the time for auto cancel the order after some minutes if payments are not done, it is working fine order is canceled after that period but not an email is generated. I have checked the email address and copy the template to my theme but not made any changes yet, To receive the emails, how To fix this issue? Note: New Order email is receiving but not this order canceled. Here is the status of Woocomerce: ### WordPress Environment ### Home URL: https://www.lfp-store.de Site URL: https://www.lfp-store.de WC Version: 3.2.5 Log Directory

Send an email notification when custom order status changes in WooCommerce

泄露秘密 提交于 2019-12-03 22:32:50
问题 I have created a custom order status in my WooCommerce called Back Order ( wc-backorder ): /** * Add custom status to order list */ add_action( 'init', 'register_custom_post_status', 10 ); function register_custom_post_status() { register_post_status( 'wc-backorder', array( 'label' => _x( 'Back Order', 'Order status', 'woocommerce' ), 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( 'Back Order

Email notification if specific cell is changed and add another cells value to message without change tracking

穿精又带淫゛_ 提交于 2019-12-03 21:33:55
What i did: If any cell in column M has been changed, then email notification has been sended to specify adres from column N at the same row. But i also need some specify body text from other columns at the same row. I did something that is working but it also causes that if other declared columns (such as project, customer, task, executor) has been changed the emil has been send to. What i need: Just track change in only one "M" column and put at the body of email additional data from other columns but from the same row. And (thats the point) did not track change at other columns, email

Add custom user email to CC for specific Woocommerce email notification

眉间皱痕 提交于 2019-12-01 14:42:18
In Woocommerce I try to customize the code from this thread to add a custom email as "CC" email address in customer completed order email notification: /** * Function adds a BCC header to emails that match our array * * @param string $headers The default headers being used * @param string $object The email type/object that is being processed */ function add_cc_to_certain_emails( $headers, $object ) { // email types/objects to add cc to $cc_email = get_user_meta( $user_id, 'order_cc_email', true ); // MY CUSTOM CODE $add_cc_to = array( 'customer_completed_order', // Customer Processing order

Add custom user email to CC for specific Woocommerce email notification

假装没事ソ 提交于 2019-12-01 12:14:31
问题 In Woocommerce I try to customize the code from this thread to add a custom email as "CC" email address in customer completed order email notification: /** * Function adds a BCC header to emails that match our array * * @param string $headers The default headers being used * @param string $object The email type/object that is being processed */ function add_cc_to_certain_emails( $headers, $object ) { // email types/objects to add cc to $cc_email = get_user_meta( $user_id, 'order_cc_email',

Send on-hold order status email notification to admin

旧城冷巷雨未停 提交于 2019-12-01 07:04:28
I want the admin to receive on hold order notification as well in WooCommerce. Right now, only customers get that notification. I have tried the following codes but it doesn't seem to work. Here is my code: add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2); function mycustom_headers_filter_function( $headers, $object ) { if ($object == 'customer_on_hold_order') { $headers .= 'BCC: My name <my@email.com>' . "\r\n"; } return $headers; } What should be the correct filter/hook to use? Thanks LoicTheAztec The correct $email_id for "on-hold" order status email