Automattic\WooCommerce\Internal\StockNotifications\Emails

CustomerStockNotificationVerifiedEmail::maybe_setup_notification_localeprivateWC 1.0

Setup notification locale if necessary based on notification meta.

Method of the class: CustomerStockNotificationVerifiedEmail{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->maybe_setup_notification_locale( $notification );
$notification(Notification) (required)
Notification object.

CustomerStockNotificationVerifiedEmail::maybe_setup_notification_locale() code WC 10.3.6

private function maybe_setup_notification_locale( $notification ) {
	$customer_locale = $notification->get_meta( '_customer_locale' );
	if ( ! empty( $customer_locale ) ) {
		switch_to_locale( $customer_locale );
	}
}