Automattic\WooCommerce\Internal\StockNotifications\Emails

CustomerStockNotificationVerifiedEmail::prepare_emailpublicWC 1.0

Prepares the email based on the notification data.

Method of the class: CustomerStockNotificationVerifiedEmail{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

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