Settings > Emails and use the store's email template. */ class Emails_Service { /** * Hooks email registration. * * @since 1.0.0 */ public function register() { add_filter( 'woocommerce_email_classes', array( $this, 'register_emails' ) ); // Make sure the mailer is initialised so each email's constructor // runs and binds its trigger before plugin events fire. add_action( 'woocommerce_init', array( $this, 'load_mailer' ) ); } /** * Adds the plugin emails to the WooCommerce mailer. * * @since 1.0.0 * @param array $emails Registered email classes. * @return array */ public function register_emails( $emails ) { $emails['PPL_AFW_Approved'] = new Approved_Email(); $emails['PPL_AFW_Rejected'] = new Rejected_Email(); $emails['PPL_AFW_New_Commission'] = new New_Commission_Email(); $emails['PPL_AFW_Payout'] = new Payout_Email(); $emails['PPL_AFW_Application'] = new Application_Email(); $emails['PPL_AFW_Admin_Referral'] = new Admin_Referral_Email(); return $emails; } /** * Loads the WooCommerce mailer. * * @since 1.0.0 */ public function load_mailer() { if ( function_exists( 'WC' ) && WC() ) { WC()->mailer(); } } }