woothemes/woocommerce — pull request #2535 by krbvroc1 (2013-02-26 20:21:57+00:00)
Title: Add WC Email send filtering based on object

In my plugin I generate my own emails for subscription orders (order contains a subscription product type)

There does not appear to be anyway using WC Email to accomplish this so this filter is an elegant solution. The is_enabled() method now uses a filter which gets passed the associated email object so the filter can decide to override the email sending.

Using this filter, I can now hook
woocommerce_email_enabled_customer_completed_order
woocommerce_email_enabled_new_order

examine the order and disable the email.