PHP Класс WC_Emails

WooCommerce Emails Class which handles the sending on transactional emails and email templates. This class loads in available emails.
Автор: WooThemes
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$emails Array of email notification classes

Защищенные свойства (Protected)

Свойство Тип Описание
$_instance The single instance of the class

Открытые методы

Метод Описание
__clone ( ) Cloning is forbidden.
__construct ( ) Constructor for the email class hooks in all emails that can be sent.
__wakeup ( ) Unserializing instances of this class is forbidden.
backorder ( array $args ) Backorder notification email.
customer_detail_field_is_valid ( array $field ) : boolean Is customer detail field valid?
customer_details ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false ) : string Add customer details to email templates.
customer_invoice ( $order ) Prepare and send the customer invoice email on demand.
customer_new_account ( integer $customer_id, array $new_customer_data = [], $password_generated = false ) Customer new account welcome email.
email_addresses ( $order, $sent_to_admin = false, $plain_text = false ) Get the email addresses.
email_footer ( ) Get the email footer.
email_header ( mixed $email_heading ) Get the email header.
get_emails ( ) : array Return the email classes - used in admin to load settings.
get_from_address ( ) : string Get from email address.
get_from_name ( ) : string Get from name for email.
init ( ) Init email classes.
init_transactional_emails ( ) Hook in all transactional emails.
instance ( ) : WC_Emails Main WC_Emails Instance.
low_stock ( WC_Product $product ) Low stock notification email.
no_stock ( WC_Product $product ) No stock notification email.
order_details ( $order, $sent_to_admin = false, $plain_text = false, $email = '' ) Show the order details table
order_meta ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false ) : string Add order meta to email templates.
order_schema_markup ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false ) Adds Schema.org markup for order in JSON-LD format.
send ( mixed $to, mixed $subject, mixed $message, string $headers = "Content-Type: text/html ", string $attachments = "" ) : boolean Send the email.
send_transactional_email ( ) Init the mailer instance and call the notifications for the current filter.
wrap_message ( mixed $email_heading, string $message, $plain_text = false ) : string Wraps a message in the woocommerce mail template.

Приватные методы

Метод Описание
get_blogname ( ) : string Get blog name formatted for emails.

Описание методов

__clone() публичный Метод

Cloning is forbidden.
С версии: 2.1
public __clone ( )

__construct() публичный Метод

Constructor for the email class hooks in all emails that can be sent.
public __construct ( )

__wakeup() публичный Метод

Unserializing instances of this class is forbidden.
С версии: 2.1
public __wakeup ( )

backorder() публичный Метод

Backorder notification email.
public backorder ( array $args )
$args array

customer_detail_field_is_valid() публичный Метод

Is customer detail field valid?
public customer_detail_field_is_valid ( array $field ) : boolean
$field array
Результат boolean

customer_details() публичный Метод

Add customer details to email templates.
public customer_details ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false ) : string
$order mixed
$sent_to_admin boolean (default: false)
$plain_text boolean (default: false)
Результат string

customer_invoice() публичный Метод

Prepare and send the customer invoice email on demand.
public customer_invoice ( $order )

customer_new_account() публичный Метод

Customer new account welcome email.
public customer_new_account ( integer $customer_id, array $new_customer_data = [], $password_generated = false )
$customer_id integer
$new_customer_data array

email_addresses() публичный Метод

Get the email addresses.
public email_addresses ( $order, $sent_to_admin = false, $plain_text = false )

email_header() публичный Метод

Get the email header.
public email_header ( mixed $email_heading )
$email_heading mixed heading for the email

get_emails() публичный Метод

Return the email classes - used in admin to load settings.
public get_emails ( ) : array
Результат array

get_from_address() публичный Метод

Get from email address.
public get_from_address ( ) : string
Результат string

get_from_name() публичный Метод

Get from name for email.
public get_from_name ( ) : string
Результат string

init() публичный Метод

Init email classes.
public init ( )

init_transactional_emails() публичный статический Метод

Hook in all transactional emails.
public static init_transactional_emails ( )

instance() публичный статический Метод

Ensures only one instance of WC_Emails is loaded or can be loaded.
С версии: 2.1
public static instance ( ) : WC_Emails
Результат WC_Emails Main instance

low_stock() публичный Метод

Low stock notification email.
public low_stock ( WC_Product $product )
$product WC_Product

no_stock() публичный Метод

No stock notification email.
public no_stock ( WC_Product $product )
$product WC_Product

order_details() публичный Метод

Show the order details table
public order_details ( $order, $sent_to_admin = false, $plain_text = false, $email = '' )

order_meta() публичный Метод

Add order meta to email templates.
public order_meta ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false ) : string
$order mixed
$sent_to_admin boolean (default: false)
$plain_text boolean (default: false)
Результат string

order_schema_markup() публичный Метод

Adds Schema.org markup for order in JSON-LD format.
См. также: WC_Structured_Data::generate_order_data()
Устаревший: 2.7.0
С версии: 2.6.0
public order_schema_markup ( mixed $order, boolean $sent_to_admin = false, boolean $plain_text = false )
$order mixed
$sent_to_admin boolean (default: false)
$plain_text boolean (default: false)

send() публичный Метод

Send the email.
public send ( mixed $to, mixed $subject, mixed $message, string $headers = "Content-Type: text/html ", string $attachments = "" ) : boolean
$to mixed
$subject mixed
$message mixed
$headers string (default: "Content-Type: text/html\r\n")
$attachments string (default: "")
Результат boolean

send_transactional_email() публичный статический Метод

Init the mailer instance and call the notifications for the current filter.
public static send_transactional_email ( )

wrap_message() публичный Метод

Wraps a message in the woocommerce mail template.
public wrap_message ( mixed $email_heading, string $message, $plain_text = false ) : string
$email_heading mixed
$message string
Результат string

Описание свойств

$_instance защищенное статическое свойство

The single instance of the class
protected static $_instance

$emails публичное свойство

Array of email notification classes
public $emails