Automattic\WooCommerce\Internal\StockNotifications\Emails
CustomerStockNotificationEmail::prepare_email
Prepares the email based on the notification data.
Метод класса: CustomerStockNotificationEmail{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$CustomerStockNotificationEmail = new CustomerStockNotificationEmail(); $CustomerStockNotificationEmail->prepare_email( $notification ): void;
- $notification(Notification) (обязательный)
- Notification.
Код CustomerStockNotificationEmail::prepare_email() CustomerStockNotificationEmail::prepare email WC 11.2.2
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() );
}