Automattic\WooCommerce\Internal\StockNotifications\Emails

CustomerStockNotificationVerifyEmail::prepare_emailpublicWC 1.0

Prepares the email based on the notification data.

Method of the class: CustomerStockNotificationVerifyEmail{}

No Hooks.

Returns

null. Nothing (null).

Usage

$CustomerStockNotificationVerifyEmail = new CustomerStockNotificationVerifyEmail();
$CustomerStockNotificationVerifyEmail->prepare_email( $notification ): void;
$notification(Notification) (required)
Notification.

CustomerStockNotificationVerifyEmail::prepare_email() code WC 10.3.6

public function prepare_email( Notification $notification ): void {
	$this->object                         = $notification;
	$this->recipient                      = $notification->get_user_email();
	$product                              = $notification->get_product();
	$this->placeholders['{product_name}'] = preg_replace( $this->plain_search, $this->plain_replace, $product->get_name() );
	$this->placeholders['{site_title}']   = preg_replace( $this->plain_search, $this->plain_replace, $this->get_blogname() );
}