wp_mail not sending attachment

You said in your OP that the absolute path was returned, but you are using the ‘baseurl’ value which gives you a URL to the file that you can browse to. That’s a URL, which is not the same as the path to the file in the file system. This line is your issue: $attachment … Read more

Set a condition based on WooCommerce checkout city field while placing order

Updated The following code will add an additional recipient based on customer billing/shipping city, to new order admin notification: add_filter( ‘woocommerce_email_recipient_new_order’, ‘different_email_recipients’, 10, 2 ); function different_email_recipients( $recipient, $order ) { if ( ! is_a( $order, ‘WC_Order’ ) ) return $recipient; $city = $order->get_shipping_city(); $city = empty( $city ) ? $order->get_billing_city() : $city; // Conditionaly … Read more

How do I hide the purchase note in the WooCommerce ‘order completed’ email?

I think you’re correct about that code snippet only checking the for the availability of the email. But you can probably still make your alternative approach work: the WC_Email classes set $sending to true when they’re in the process of sending. So you could check something like: WC()->mailer()->emails[“WC_Email_Customer_Completed_Order”]->sending

WooCommerce: The model of e-mail is displaying only the html, not css [closed]

Well, I tested a lot of WooCommerce versions (3.3.x, 3.4.x and 3.5.x) using WP Rollback and I believe that was a error in e-mail templates that was fixed in version 3.5.2. I didn’t found nothing in the changelog about that: https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt Here is the template in WooCommerce in version 3.5.2: I have to investigate more … Read more

Send a custom WooCommerce email when custom order change [closed]

I think you need do two changes: Add a filter to woocommerce_email_actions that adds the action hook which should trigger the notification: function add_ready_to_ship_woocommerce_email_action( $email_actions ) { $email_actions[] = ‘woocommerce_order_status_ready-to-ship’; return $email_actions; } add_filter( ‘woocommerce_email_actions’, ‘add_ready_to_ship_woocommerce_email_action’ ); Change the trigger hook in the email class (add a _notification suffix): // Trigger on new paid orders … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)