you can use wc()->mailer()->emails,
which would give you a list of all the email class
instances.
// Get all the email class instances.
$emails = wc()->mailer()->emails;
// Prints all the email class names.
var_dump( array_keys( $emails ) );
// Access the default subject for new order email notifications.
$subject = $emails['WC_Email_New_Order']->get_default_subject();
$emails' can also be accessed from within a callback function hooked to the woocommerce_email_classes filter. Example for overriding a specific class:
// By default, $emails is an array of '{CLASS NAME}' => {The class instance}.
add_filter( 'woocommerce_email_classes', function( $emails ){
$emails['WC_Email_New_Order'] = include 'path/to/your/custom/class.php';
/* Or if the class file is already "included":
$emails['WC_Email_New_Order'] = new My_Custom_WC_Email_New_Order_Class();
*/
return $emails;
} );
The idle way to access the emails
Usewc()->mailer()->get_emails(),
except from within a callback function hooked to the woocommerce_email_classes filter.
// Both of these work, but the latter is preferred.
$emails = wc()->mailer()->emails;
$emails = wc()->mailer()->get_emails();