email-notifications

Custom “reply to” email header in Woocommerce New Order email notification

无人久伴 提交于 2019-12-19 09:39:19
问题 I'm looking to filter the email headers of the new order form in woocommerce. I'm trying to replace the customer email address with the main site admin email address. We need to do this because Gmail is flagging new orders as spam because the from address is not the same as the reply to address. The function below works partially: add_filter( 'woocommerce_email_headers', 'woo_add_reply_to_wc_admin_new_order', 10, 3 ); function woo_add_reply_to_wc_admin_new_order( $headers = '', $id = '',

Displaying a coupon message on emails for completed order status only

纵然是瞬间 提交于 2019-12-19 04:58:11
问题 I've got that code that displays a coupon message in the email orders if the customer has not used any in this order. I would like to display that coupon message only on completed order instead on all mails. add_action( 'woocommerce_email_before_order_table', 'processing_order_mail_message', 20 ); function processing_order_mail_message( $order ) { if ( empty( $order->get_used_coupons() ) && ( $order->post_status == 'wc-on-hold' || $order->post_status == 'wc-processing' ) ) echo '<h2 id=

Add custom meta data into emails as a html styled table with a title in Woocommerce

荒凉一梦 提交于 2019-12-19 04:01:55
问题 In WooCommerce, "Get a custom field array values within WooCommerce email order meta" answer code to one of my previous questions, has given me the way to pull fields out of an array from the order post meta data. But how would I take this code and adjust it, to add a heading above the new data and a table around the data, within the email? I would like to add a <h2>Attendee Info</h2> above the output of the fields. In addition I'd like to wrap the field output in a <table> . I would like to

Add a custom text to specific email notification for local pickup Woocommerce orders

随声附和 提交于 2019-12-18 18:42:32
问题 I tried the following code that is displaying a message to all those customers who should receive a customer_processing_order and customer_completed_order when local_pickup is the chosen shipping method. I noticed I do not store any _shipping_method item within any order meta, but only a thing like: order_item_type: shipping > method_id > local_pickup:3 How can I retrieve it? I tried this of code without success: // testo per Ritiro in Sede add_action( 'woocommerce_email_order_details', 'my

Add a custom text to specific email notification for local pickup Woocommerce orders

坚强是说给别人听的谎言 提交于 2019-12-18 18:41:13
问题 I tried the following code that is displaying a message to all those customers who should receive a customer_processing_order and customer_completed_order when local_pickup is the chosen shipping method. I noticed I do not store any _shipping_method item within any order meta, but only a thing like: order_item_type: shipping > method_id > local_pickup:3 How can I retrieve it? I tried this of code without success: // testo per Ritiro in Sede add_action( 'woocommerce_email_order_details', 'my

Get the email id in Woocommerce emails

巧了我就是萌 提交于 2019-12-18 04:25:11
问题 I have custom statuses and custom emails set up in Woocommerce. I would like to use the current email, WC_Email , not the current status as a variable inside email templates. I need to have some if statements in the email templates. I am not using the order status to ensure if an email from an order gets resent manually it doesn't send data for the current order status with an separate email. How can I echo the WC_Email email ID as a variable in Woocommerce? 回答1: The wc_order_email class or

Remove Cash On Delivery Instructions From WooCommerce Emails

最后都变了- 提交于 2019-12-13 15:31:14
问题 Here is what my email looks like currently: I have spent some time trying to remove this: 'Pay wish cash upon arriving to destination.' But cannot make it go away without removing other stuff. Please help if you can. Thank you. 回答1: — Update 1 — In backend, if you go to WooCommerce > settings > Checkout > Cash on Delivery (tab), you will see: You will be able to remove "Pay wish cash upon arriving to destination." instructions message, or to replace it with something more convenient. You

Email recipients based on Shipping method Id for Woocommerce new order notification

末鹿安然 提交于 2019-12-13 10:35:51
问题 In Woocommerce, I would like to have a new order email sent to specific persons based on the selected shipping method ID. Right now, I am only able to have every email address added to the new order email, but ultimately want to have the email be sent to one specific email based on the shipping method Id selected by the customer. Here is my code coming from this answer that works for postal code: add_filter( 'new_order' , 'so_26429482_add_recipient', 20, 2 ); function so_26429482_add

Get custom email placeholder value on Woocommerce custom email content

笑着哭i 提交于 2019-12-12 21:53:06
问题 I've created my own email class in WooCommerce. Because I need a custom parameter in my email content, I've added a placeholder with this custom parameter to the wc email trigger function: public function trigger( $order_id, $firstname, $lastname, $order = false ) { $this->setup_locale(); if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { $order = wc_get_order( $order_id ); } if ( is_a( $order, 'WC_Order' ) ) { $this->object = $order; $this->recipient = $this->object->get_billing_email();

Change email subjects for some specific email notifications in Woocommerce

泄露秘密 提交于 2019-12-11 09:49:23
问题 I would like to standardize structure of email subjects (for all Woocommerce emails notifications). Im using all available filters from here But what about “On hold”, “Cancelled”, “Refunded” and “Failed order” email subjects? Is there way to change email subject for those emails? 回答1: Below the 4 hooked functions with the correct filter hooks, that will allow you to customize the email subjects for “On hold”, “Cancelled”, “Refunded” and “Failed order” notifications: add_filter( 'woocommerce