Automattic\WooCommerce\EmailEditor\Engine
Send_Preview_Email::send_email
Sends an email preview.
Метод класса: Send_Preview_Email{}
Хуков нет.
Возвращает
true|false
. Returns true if the email was sent successfully, false otherwise.
Использование
$Send_Preview_Email = new Send_Preview_Email(); $Send_Preview_Email->send_email( $to, $subject, $body ): bool;
- $to(строка) (обязательный)
- The recipient email address.
- $subject(строка) (обязательный)
- The subject of the email.
- $body(строка) (обязательный)
- The body content of the email.
Код Send_Preview_Email::send_email() Send Preview Email::send email WC 10.0.2
public function send_email( string $to, string $subject, string $body ): bool { add_filter( 'wp_mail_content_type', array( $this, 'set_mail_content_type' ) ); $result = wp_mail( $to, $subject, $body ); // Reset content-type to avoid conflicts. remove_filter( 'wp_mail_content_type', array( $this, 'set_mail_content_type' ) ); return $result; }