WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Notes\MerchantEmailNotifications

MerchantEmailNotifications::trigger_notification_action() public WC 1.0

Trigger the note action.

{} It's a method of the class: MerchantEmailNotifications{}

No Hooks.

Return

null. Nothing.

Usage

$result = MerchantEmailNotifications::trigger_notification_action();

Code of MerchantEmailNotifications::trigger_notification_action() WC 5.3.0

<?php
public static function trigger_notification_action() {
	/* phpcs:disable WordPress.Security.NonceVerification */
	if (
		! isset( $_GET['external_redirect'] ) ||
		1 !== intval( $_GET['external_redirect'] ) ||
		! isset( $_GET['note'] ) ||
		! isset( $_GET['action'] )
	) {
		return;
	}
	$note_id   = intval( $_GET['note'] );
	$action_id = intval( $_GET['action'] );
	/* phpcs:enable */

	$note = Notes::get_note( $note_id );

	if ( ! $note ) {
		return;
	}

	$triggered_action = Notes::get_action_by_id( $note, $action_id );

	if ( ! $triggered_action ) {
		return;
	}

	Notes::trigger_note_action( $note, $triggered_action );

	$url = $triggered_action->query;

	// We will use "wp_safe_redirect" when it's an internal redirect.
	if ( strpos( $url, 'http' ) === false ) {
		wp_safe_redirect( $url );
	} else {
		header( 'Location: ' . $url );
	}
	exit();
}