Have Customer Invoice email accept order id as param too

This commit is contained in:
Coen Jacobs 2012-10-12 15:37:33 +02:00
parent eb90b0ed10
commit bfd041a197
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,10 @@ class WC_Email_Customer_Invoice extends WC_Email {
function trigger( $order ) { function trigger( $order ) {
global $woocommerce; global $woocommerce;
if ( ! is_object( $order ) ) {
$order = new WC_Order( absint( $order ) );
}
if ( $order ) { if ( $order ) {
$this->object = $order; $this->object = $order;
$this->recipient = $this->object->billing_email; $this->recipient = $this->object->billing_email;