Automattic\WooCommerce\Internal\Admin\Notes

MerchantEmailNotifications::run()public staticWC 1.0

Send all the notifications type email.

Метод класса: MerchantEmailNotifications{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$result = MerchantEmailNotifications::run();

Код MerchantEmailNotifications::run() WC 7.1.0

public static function run() {
	$data_store = Notes::load_data_store();
	$notes      = $data_store->get_notes(
		array(
			'type'   => array( Note::E_WC_ADMIN_NOTE_EMAIL ),
			'status' => array( 'unactioned' ),
		)
	);

	foreach ( $notes as $note ) {
		$note = Notes::get_note( $note->note_id );
		if ( $note ) {
			self::send_merchant_notification( $note );
			$note->set_status( 'sent' );
			$note->save();
		}
	}
}