Automattic\WooCommerce\Internal\Admin\Notes

MerchantEmailNotifications::run()public staticWC 1.0

Send all the notifications type email.

Method of the class: MerchantEmailNotifications{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = MerchantEmailNotifications::run();

MerchantEmailNotifications::run() code WC 8.6.1

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();
		}
	}
}