WC_Emails::send_transactional_email()public staticWC 1.0

Init the mailer instance and call the notifications for the current filter.

Method of the class: WC_Emails{}

Hooks from the method

Return

null. Nothing (null).

Usage

$result = WC_Emails::send_transactional_email( $args );
$args(array)
Email args .
Default: [])

WC_Emails::send_transactional_email() code WC 9.4.2

public static function send_transactional_email( $args = array() ) {
	try {
		$args = func_get_args();
		self::instance(); // Init self so emails exist.
		do_action_ref_array( current_filter() . '_notification', $args );
	} catch ( Exception $e ) {
		$error  = 'Transactional email triggered fatal error for callback ' . current_filter();
		$logger = wc_get_logger();
		$logger->critical(
			$error . PHP_EOL,
			array(
				'source' => 'transactional-emails',
			)
		);
		if ( Constants::is_true( 'WP_DEBUG' ) ) {
			trigger_error( $error, E_USER_WARNING ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped, WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
		}
	}
}