Woo-Commerce Send mail by code. [closed]

After doing some research on google and woocommerce code i found the ans of the what i what. i have use following function for to send the mail to the user once order have been generated using the custom code in wordpress woo-commerce. WC()->mailer()->emails[‘WC_Email_Customer_Processing_Order’]->trigger($orderId);

How to override email text New Customer Order?

The easiest way to override the WooCommerce emails is to copy woocommerce/templates/emails/admin-new-order.php to yourtheme/woocommerce/emails/admin-new-order.php and make any changes in your version of the template. This will ensure that any changes you make do not get lost during any subsequent upgrades. The text displayed in the subject line of the email is controlled via the GUI … Read more

Output fields manually in Woocommerce email templates

Probably the easiest way is to manually construct a new Billing address format by creating a copy of the WooCommerce email address template in /your-theme-driectory/woocommerce/emails/email-addresses.php by replacing the original echo $order->get_formatted_billing_address(); with for example: $output=”<strong>Customer Name: </strong>”.get_post_meta($order->id, ‘_billing_first_name’, true).'<br>’; $output .= ‘<strong>Customer Last Name: </strong>’.get_post_meta($order->id, ‘_billing_last_name’, true).'<br>’; $output .= ‘<strong>Company Name: </strong>’.get_post_meta($order->id, ‘_billing_company’, true).'<br>’; $output … Read more

Send email notification when meet the condition

You can use this code to automatically send an email whenever a post of the type one is published. This goes into your theme’s functions.php : <?php function post_published_notification( $ID, $post ) { $type = get_post_type($ID); if ($type == ‘post-type-one’){ $author = $post->post_author; /* Post author ID. */ $name = get_the_author_meta( ‘display_name’, $author ); $email … Read more