PHP Класс WC_Email

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

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

Свойство Тип Описание
$description string Description for the email.
$enabled 'yes' if the method is enabled.
$find array Strings to find in subjects/headings.
$heading string Heading for the email content.
$id String Email method ID.
$mime_boundary string Mime boundary (for multipart emails).
$mime_boundary_header string Mime boundary header (for multipart emails).
$object object | boolean Object this email is for, for example a customer, product, or email.
$plain_replace array @var array $plain_replace
$plain_search array https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc
$recipient string Recipients for the email.
$replace array Strings to replace in subjects/headings.
$sending boolean True when email is being sent.
$subject string Subject for the email.
$template_base string Template path.
$template_html string HTML template path.
$template_plain string Plain text template path.
$title string Email method title.

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

Свойство Тип Описание
$customer_email boolean True when the email notification is sent to customers.
$manual boolean True when the email notification is sent manually only.

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

Метод Описание
__construct ( ) Constructor.
admin_options ( ) Admin Options.
format_string ( mixed $string ) : string Format email string.
get_attachments ( ) : string Get email attachments.
get_blogname ( ) : string Get WordPress blog name.
get_content ( ) : string Get email content.
get_content_html ( ) : string Get the email content in HTML format.
get_content_plain ( ) : string Get the email content in plain text format.
get_content_type ( ) : string Get email content type.
get_description ( ) : string Return the email's description
get_email_type ( ) : string get_type function.
get_email_type_options ( ) : array Email type options.
get_from_address ( ) : string Get the from address for outgoing emails.
get_from_name ( ) : string Get the from name for outgoing emails.
get_headers ( ) : string Get email headers.
get_heading ( ) : string Get email heading.
get_option ( string $key, mixed $empty_value = null ) : string Proxy to parent's get_option and attempt to localize the result using gettext.
get_recipient ( ) : string Get valid recipients.
get_subject ( ) : string Get email subject.
get_template ( string $type ) : string Get template.
get_theme_template_file ( string $template ) : string Get the template file in the current theme.
get_title ( ) : string Return the email's title
handle_multipart ( PHPMailer $mailer ) : PHPMailer Handle multipart mail.
init_form_fields ( ) Initialise Settings Form Fields - these are generic email options most will use.
is_customer_email ( ) : boolean Checks if this email is customer focussed.
is_enabled ( ) : boolean Checks if this email is enabled and will be sent.
is_manual ( ) : boolean Checks if this email is manually sent
process_admin_options ( ) Admin Panel Options Processing.
send ( string $to, string $subject, string $message, string $headers, string $attachments ) : boolean Send an email.
style_inline ( string | null $content ) : string Apply inline styles to dynamic content.

Защищенные методы

Метод Описание
admin_actions ( ) Admin actions.
delete_template_action ( string $template_type ) Delete template action.
move_template_action ( string $template_type ) Move template action.
save_template ( string $template_code, string $template_path ) Save the email templates.

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

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

Constructor.
public __construct ( )

admin_actions() защищенный Метод

Admin actions.
protected admin_actions ( )

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

Setup the email settings screen. Override this in your email.
С версии: 1.0.0
public admin_options ( )

delete_template_action() защищенный Метод

Delete template action.
protected delete_template_action ( string $template_type )
$template_type string

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

Format email string.
public format_string ( mixed $string ) : string
$string mixed
Результат string

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

Get email attachments.
public get_attachments ( ) : string
Результат string

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

Get WordPress blog name.
public get_blogname ( ) : string
Результат string

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

Get email content.
public get_content ( ) : string
Результат string

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

Get the email content in HTML format.
public get_content_html ( ) : string
Результат string

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

Get the email content in plain text format.
public get_content_plain ( ) : string
Результат string

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

Get email content type.
public get_content_type ( ) : string
Результат string

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

Return the email's description
public get_description ( ) : string
Результат string

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

get_type function.
public get_email_type ( ) : string
Результат string

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

Email type options.
public get_email_type_options ( ) : array
Результат array

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

Get the from address for outgoing emails.
public get_from_address ( ) : string
Результат string

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

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

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

Get email headers.
public get_headers ( ) : string
Результат string

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

Get email heading.
public get_heading ( ) : string
Результат string

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

Proxy to parent's get_option and attempt to localize the result using gettext.
public get_option ( string $key, mixed $empty_value = null ) : string
$key string
$empty_value mixed
Результат string

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

Get valid recipients.
public get_recipient ( ) : string
Результат string

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

Get email subject.
public get_subject ( ) : string
Результат string

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

Get template.
public get_template ( string $type ) : string
$type string
Результат string

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

Get the template file in the current theme.
public get_theme_template_file ( string $template ) : string
$template string
Результат string

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

Return the email's title
public get_title ( ) : string
Результат string

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

Handle multipart mail.
public handle_multipart ( PHPMailer $mailer ) : PHPMailer
$mailer PHPMailer
Результат PHPMailer

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

Initialise Settings Form Fields - these are generic email options most will use.
public init_form_fields ( )

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

Checks if this email is customer focussed.
public is_customer_email ( ) : boolean
Результат boolean

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

Checks if this email is enabled and will be sent.
public is_enabled ( ) : boolean
Результат boolean

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

Checks if this email is manually sent
public is_manual ( ) : boolean
Результат boolean

move_template_action() защищенный Метод

Move template action.
protected move_template_action ( string $template_type )
$template_type string

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

Admin Panel Options Processing.

save_template() защищенный Метод

Save the email templates.
С версии: 2.4.0
protected save_template ( string $template_code, string $template_path )
$template_code string
$template_path string

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

Send an email.
public send ( string $to, string $subject, string $message, string $headers, string $attachments ) : boolean
$to string
$subject string
$message string
$headers string
$attachments string
Результат boolean success

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

Apply inline styles to dynamic content.
public style_inline ( string | null $content ) : string
$content string | null
Результат string

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

$customer_email защищенное свойство

True when the email notification is sent to customers.
protected bool $customer_email
Результат boolean

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

Description for the email.
public string $description
Результат string

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

'yes' if the method is enabled.
public $enabled

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

Strings to find in subjects/headings.
public array $find
Результат array

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

Heading for the email content.
public string $heading
Результат string

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

Email method ID.
public String $id
Результат String

$manual защищенное свойство

True when the email notification is sent manually only.
protected bool $manual
Результат boolean

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

Mime boundary (for multipart emails).
public string $mime_boundary
Результат string

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

Mime boundary header (for multipart emails).
public string $mime_boundary_header
Результат string

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

Object this email is for, for example a customer, product, or email.
public object|bool $object
Результат object | boolean

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

@var array $plain_replace
public array $plain_replace
Результат array

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

Recipients for the email.
public string $recipient
Результат string

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

Strings to replace in subjects/headings.
public array $replace
Результат array

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

True when email is being sent.
public bool $sending
Результат boolean

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

Subject for the email.
public string $subject
Результат string

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

Template path.
public string $template_base
Результат string

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

HTML template path.
public string $template_html
Результат string

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

Plain text template path.
public string $template_plain
Результат string

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

Email method title.
public string $title
Результат string