WooCommerce Code Reference

Search results

WC_Email_Customer_Processing_Order extends WC_Email

Customer Processing Order Email.

An email sent to the customer when a new order is paid for.

Table of Contents

$id ID of the class extending the settings API. Used in option names. string
$title Email method title. string
$enabled 'yes' if the method is enabled. string
$description Description for the email. string
$heading Default heading. string
$subject Default subject. string
$template_plain Plain text template path. string
$template_html HTML template path. string
$template_base Template path. string
$recipient Recipients for the email. string
$object Object this email is for, for example a customer, product, or email. object|bool
$mime_boundary Mime boundary (for multipart emails). string
$mime_boundary_header Mime boundary header (for multipart emails). string
$sending True when email is being sent. bool
$manual True when the email notification is sent manually only. bool
$customer_email True when the email notification is sent to customers. bool
$plain_search List of preg* regular expression patterns to search for, used in conjunction with $plain_replace. array
$plain_replace List of pattern replacements corresponding to patterns searched.
$placeholders Strings to find/replace in subjects/headings. array
$find Strings to find in subjects/headings. array
$replace Strings to replace in subjects/headings. array
$plugin_id The plugin ID. Used for option names. string
$errors Validation errors. array
$settings Setting values. array
$form_fields Form option fields. array
$data The posted settings data. When empty, $_POST data will be used. array
__construct() Constructor. mixed
get_default_subject() Get email subject. string
get_default_heading() Get email heading. string
trigger() Trigger the sending of this email. mixed
get_content_html() Get content html. string
get_content_plain() Get content plain. string
get_default_additional_content() Default content to show below main email content. string
__construct() Constructor. mixed
handle_multipart() Handle multipart mail. PHPMailer
format_string() Format email string. string
setup_locale() Set the locale to the store locale for customer emails to make sure emails are in the store language. mixed
restore_locale() Restore the locale to the default locale. Use after finished with setup_locale. mixed
get_default_subject() Get email subject. string
get_default_heading() Get email heading. string
get_default_additional_content() Default content to show below main email content. string
get_additional_content() Return content from the additional_content field. string
get_subject() Get email subject. string
get_heading() Get email heading. string
get_recipient() Get valid recipients. string
get_headers() Get email headers. string
get_attachments() Get email attachments. array
get_email_type() Return email type. string
get_content_type() Get email content type. string
get_title() Return the email's title string
get_description() Return the email's description string
get_option() Get option from DB. string
is_enabled() Checks if this email is enabled and will be sent. bool
is_manual() Checks if this email is manually sent bool
is_customer_email() Checks if this email is customer focussed. bool
get_blogname() Get WordPress blog name. string
get_content() Get email content. string
style_inline() Apply inline styles to dynamic content. string
supports_emogrifier() Return if emogrifier library is supported. bool
get_content_plain() Get the email content in plain text format. string
get_content_html() Get the email content in HTML format. string
get_from_name() Get the from name for outgoing emails. string
get_from_address() Get the from address for outgoing emails. string
send() Send an email. bool
init_form_fields() Initialise settings form fields. mixed
get_email_type_options() Email type options. array
process_admin_options() Processes and saves options. bool
get_template() Get template. string
save_template() Save the email templates. mixed
get_theme_template_file() Get the template file in the current theme. string
move_template_action() Move template action. mixed
delete_template_action() Delete template action. mixed
admin_actions() Admin actions. mixed
admin_options() Output the admin options table. mixed
get_form_fields() Get the form fields after they are initialized. array
set_defaults() Set default required properties for each field. array
get_option_key() Return the name of the option in the WP DB. string
get_field_type() Get a fields type. Defaults to "text" if not set. string
get_field_default() Get a fields default value. Defaults to "" if not set. string
get_field_value() Get a field's posted and validated value. string
set_post_data() Sets the POSTed data. This method can be used to set specific data, instead of taking it from the $_POST array. mixed
get_post_data() Returns the POSTed data, to be used to save the settings. array
update_option() Update a single option. bool
add_error() Add an error message for display in admin on save. mixed
get_errors() Get admin error messages. mixed
display_errors() Display admin error messages. mixed
init_settings() Initialise Settings. mixed
get_field_key() Prefix key for settings. string
generate_settings_html() Generate Settings HTML. string
get_tooltip_html() Get HTML for tooltips. string
get_description_html() Get HTML for descriptions. string
get_custom_attribute_html() Get custom attributes. string
generate_text_html() Generate Text Input HTML. string
generate_price_html() Generate Price Input HTML. string
generate_decimal_html() Generate Decimal Input HTML. string
generate_password_html() Generate Password Input HTML. string
generate_color_html() Generate Color Picker Input HTML. string
generate_textarea_html() Generate Textarea HTML. string
generate_checkbox_html() Generate Checkbox HTML. string
generate_select_html() Generate Select HTML. string
generate_multiselect_html() Generate Multiselect HTML. string
generate_title_html() Generate Title HTML. string
validate_text_field() Validate Text Field. string
validate_price_field() Validate Price Field. string
validate_decimal_field() Validate Decimal Field. string
validate_password_field() Validate Password Field. No input sanitization is used to avoid corrupting passwords. string
validate_textarea_field() Validate Textarea Field. string
validate_checkbox_field() Validate Checkbox Field. string
validate_select_field() Validate Select Field. string
validate_multiselect_field() Validate Multiselect Field. string|array
validate_settings_fields() Validate the data on the "Settings" form. mixed
format_settings() Format settings if needed. array

Properties

$description

Description for the email.

public string $description

$heading

Default heading.

public string $heading = ''
Supported for backwards compatibility but we recommend overloading the get_default_x methods instead so localization can be done when needed.

$subject

Default subject.

public string $subject = ''
Supported for backwards compatibility but we recommend overloading the get_default_x methods instead so localization can be done when needed.

$template_plain

Plain text template path.

public string $template_plain

$object

Object this email is for, for example a customer, product, or email.

public object|bool $object

$mime_boundary

Mime boundary (for multipart emails).

public string $mime_boundary

$mime_boundary_header

Mime boundary header (for multipart emails).

public string $mime_boundary_header

$manual

True when the email notification is sent manually only.

protected bool $manual = \false

$customer_email

True when the email notification is sent to customers.

protected bool $customer_email = \false

$plain_search

List of preg* regular expression patterns to search for, used in conjunction with $plain_replace.

public array $plain_search = array( "/\r/", // Non-legal carriage return. '/&(nbsp|#0*160);/i', // Non-breaking space. '/&(quot|rdquo|ldquo|#0*8220|#0*8221|#0*147|#0*148);/i', // Double quotes. '/&(apos|rsquo|lsquo|#0*8216|#0*8217);/i', // Single quotes. '/>/i', // Greater-than. '/</i', // Less-than. '/&#0*38;/i', // Ampersand. '/&/i', // Ampersand. '/&(copy|#0*169);/i', // Copyright. '/&(trade|#0*8482|#0*153);/i', // Trademark. '/&(reg|#0*174);/i', // Registered. '/&(mdash|#0*151|#0*8212);/i', // mdash. '/&(ndash|minus|#0*8211|#0*8722);/i', // ndash. '/&(bull|#0*149|#0*8226);/i', // Bullet. '/&(pound|#0*163);/i', // Pound sign. '/&(euro|#0*8364);/i', // Euro sign. '/&(dollar|#0*36);/i', // Dollar sign. '/&[^&\\s;]+;/i', // Unknown/unhandled entities. '/[ ]{2,}/', )
https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc

$plain_replace

List of pattern replacements corresponding to patterns searched.

public mixed $plain_replace = array( '', // Non-legal carriage return. ' ', // Non-breaking space. '"', // Double quotes. "'", // Single quotes. '>', // Greater-than. '<', // Less-than. '&', // Ampersand. '&', // Ampersand. '(c)', // Copyright. '(tm)', // Trademark. '(R)', // Registered. '--', // mdash. '-', // ndash. '*', // Bullet. '£', // Pound sign. 'EUR', // Euro sign. € ?. '$', // Dollar sign. '', // Unknown/unhandled entities. ' ', )
@var array $plain_replace

$placeholders

Strings to find/replace in subjects/headings.

protected array $placeholders = array()

$find

Strings to find in subjects/headings.

public array $find = array()

$replace

Strings to replace in subjects/headings.

public array $replace = array()

Methods

__construct()

Constructor.

public __construct( ) : mixed
Return values
mixed

handle_multipart()

Handle multipart mail.

public handle_multipart( $mailer : PHPMailer ) : PHPMailer
Parameters
$mailer : PHPMailer

PHPMailer object.

Return values
PHPMailer

format_string()

Format email string.

public format_string( $string : mixed ) : string
Parameters
$string : mixed

Text to replace placeholders in.

Return values
string

setup_locale()

Set the locale to the store locale for customer emails to make sure emails are in the store language.

public setup_locale( ) : mixed
Return values
mixed

restore_locale()

Restore the locale to the default locale. Use after finished with setup_locale.

public restore_locale( ) : mixed
Return values
mixed

get_default_subject()

Get email subject.

public get_default_subject( ) : string
Tags
since
Return values
string

get_default_heading()

Get email heading.

public get_default_heading( ) : string
Tags
since
Return values
string

get_default_additional_content()

Default content to show below main email content.

public get_default_additional_content( ) : string
Tags
since
Return values
string

get_additional_content()

Return content from the additional_content field.

public get_additional_content( ) : string

Displayed above the footer.

Tags
since
Return values
string

get_subject()

Get email subject.

public get_subject( ) : string
Return values
string

get_heading()

Get email heading.

public get_heading( ) : string
Return values
string

get_recipient()

Get valid recipients.

public get_recipient( ) : string
Return values
string

get_headers()

Get email headers.

public get_headers( ) : string
Return values
string

get_attachments()

Get email attachments.

public get_attachments( ) : array
Return values
array

get_email_type()

Return email type.

public get_email_type( ) : string
Return values
string

get_content_type()

Get email content type.

public get_content_type( [ $default_content_type : string = '' ] ) : string
Parameters
$default_content_type : string = ''

Default wp_mail() content type.

Return values
string

get_title()

Return the email's title

public get_title( ) : string
Return values
string

get_description()

Return the email's description

public get_description( ) : string
Return values
string

get_option()

Get option from DB.

public get_option( $key : string [, $empty_value : mixed = null ] ) : string

Gets an option from the settings API, using defaults if necessary to prevent undefined notices.

Parameters
$key : string

Option key.

$empty_value : mixed = null

Value when empty.

Return values
string

The value specified for the option or a default value for the option.

is_enabled()

Checks if this email is enabled and will be sent.

public is_enabled( ) : bool
Return values
bool

is_manual()

Checks if this email is manually sent

public is_manual( ) : bool
Return values
bool

is_customer_email()

Checks if this email is customer focussed.

public is_customer_email( ) : bool
Return values
bool

get_blogname()

Get WordPress blog name.

public get_blogname( ) : string
Return values
string

get_content()

Get email content.

public get_content( ) : string
Return values
string

style_inline()

Apply inline styles to dynamic content.

public style_inline( $content : string|null ) : string

We only inline CSS for html emails, and to do so we use Emogrifier library (if supported).

Parameters
$content : string|null

Content that will receive inline styles.

Tags
version
Return values
string

supports_emogrifier()

Return if emogrifier library is supported.

protected supports_emogrifier( ) : bool
Tags
version
since
Return values
bool

get_content_plain()

Get the email content in plain text format.

public get_content_plain( ) : string
Return values
string

get_content_html()

Get the email content in HTML format.

public get_content_html( ) : string
Return values
string

get_from_name()

Get the from name for outgoing emails.

public get_from_name( [ $from_name : string = '' ] ) : string
Parameters
$from_name : string = ''

Default wp_mail() name associated with the "from" email address.

Return values
string

get_from_address()

Get the from address for outgoing emails.

public get_from_address( [ $from_email : string = '' ] ) : string
Parameters
$from_email : string = ''

Default wp_mail() email address to send from.

Return values
string

send()

Send an email.

public send( $to : string , $subject : string , $message : string , $headers : string , $attachments : array ) : bool
Parameters
$to : string

Email to.

$subject : string

Email subject.

$message : string

Email message.

$headers : string

Email headers.

$attachments : array

Email attachments.

Return values
bool

success

init_form_fields()

Initialise settings form fields.

public init_form_fields( ) : mixed

Add an array of fields to be displayed on the gateway's settings screen.

Tags
since
Return values
mixed

get_email_type_options()

Email type options.

public get_email_type_options( ) : array
Return values
array

process_admin_options()

Processes and saves options.

public process_admin_options( ) : bool

If there is an error thrown, will continue to save and validate fields, but will leave the erroring field out.

Return values
bool

was anything saved?

get_template()

Get template.

public get_template( $type : string ) : string
Parameters
$type : string

Template type. Can be either 'template_html' or 'template_plain'.

Return values
string

save_template()

Save the email templates.

protected save_template( $template_code : string , $template_path : string ) : mixed
Parameters
$template_code : string

Template code.

$template_path : string

Template path.

Tags
since
Return values
mixed

get_theme_template_file()

Get the template file in the current theme.

public get_theme_template_file( $template : string ) : string
Parameters
$template : string

Template name.

Return values
string

move_template_action()

Move template action.

protected move_template_action( $template_type : string ) : mixed
Parameters
$template_type : string

Template type.

Return values
mixed

delete_template_action()

Delete template action.

protected delete_template_action( $template_type : string ) : mixed
Parameters
$template_type : string

Template type.

Return values
mixed

admin_actions()

Admin actions.

protected admin_actions( ) : mixed
Return values
mixed

get_form_fields()

Get the form fields after they are initialized.

public get_form_fields( ) : array
Return values
array

of options

set_defaults()

Set default required properties for each field.

protected set_defaults( $field : array ) : array
Parameters
$field : array

Setting field array.

Return values
array

get_option_key()

Return the name of the option in the WP DB.

public get_option_key( ) : string
Tags
since
Return values
string

get_field_type()

Get a fields type. Defaults to "text" if not set.

public get_field_type( $field : array ) : string
Parameters
$field : array

Field key.

Return values
string

get_field_default()

Get a fields default value. Defaults to "" if not set.

public get_field_default( $field : array ) : string
Parameters
$field : array

Field key.

Return values
string

get_field_value()

Get a field's posted and validated value.

public get_field_value( $key : string , $field : array [, $post_data : array = array() ] ) : string
Parameters
$key : string

Field key.

$field : array

Field array.

$post_data : array = array()

Posted data.

Return values
string

set_post_data()

Sets the POSTed data. This method can be used to set specific data, instead of taking it from the $_POST array.

public set_post_data( [ $data : array = array() ] ) : mixed
Parameters
$data : array = array()

Posted data.

Return values
mixed

get_post_data()

Returns the POSTed data, to be used to save the settings.

public get_post_data( ) : array
Return values
array

update_option()

Update a single option.

public update_option( $key : string [, $value : mixed = '' ] ) : bool
Parameters
$key : string

Option key.

$value : mixed = ''

Value to set.

Tags
since
Return values
bool

was anything saved?

add_error()

Add an error message for display in admin on save.

public add_error( $error : string ) : mixed
Parameters
$error : string

Error message.

Return values
mixed

init_settings()

Initialise Settings.

public init_settings( ) : mixed

Store all settings in a single database entry and make sure the $settings array is either the default or the settings stored in the database.

Tags
since
uses

get_option(), add_option()

Return values
mixed

get_field_key()

Prefix key for settings.

public get_field_key( $key : string ) : string
Parameters
$key : string

Field key.

Return values
string

generate_settings_html()

Generate Settings HTML.

public generate_settings_html( [ $form_fields : array = array() ] [, $echo : bool = true ] ) : string

Generate the HTML for the fields on the "settings" screen.

Parameters
$form_fields : array = array()

(default: array()) Array of form fields.

$echo : bool = true

Echo or return.

Tags
since
uses
Return values
string

the html for the settings

get_tooltip_html()

Get HTML for tooltips.

public get_tooltip_html( $data : array ) : string
Parameters
$data : array

Data for the tooltip.

Return values
string

get_description_html()

Get HTML for descriptions.

public get_description_html( $data : array ) : string
Parameters
$data : array

Data for the description.

Return values
string

get_custom_attribute_html()

Get custom attributes.

public get_custom_attribute_html( $data : array ) : string
Parameters
$data : array

Field data.

Return values
string

generate_text_html()

Generate Text Input HTML.

public generate_text_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_price_html()

Generate Price Input HTML.

public generate_price_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_decimal_html()

Generate Decimal Input HTML.

public generate_decimal_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_password_html()

Generate Password Input HTML.

public generate_password_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_color_html()

Generate Color Picker Input HTML.

public generate_color_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_textarea_html()

Generate Textarea HTML.

public generate_textarea_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_checkbox_html()

Generate Checkbox HTML.

public generate_checkbox_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_select_html()

Generate Select HTML.

public generate_select_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_multiselect_html()

Generate Multiselect HTML.

public generate_multiselect_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

generate_title_html()

Generate Title HTML.

public generate_title_html( $key : string , $data : array ) : string
Parameters
$key : string

Field key.

$data : array

Field data.

Tags
since
Return values
string

validate_text_field()

Validate Text Field.

public validate_text_field( $key : string , $value : string ) : string

Make sure the data is escaped correctly, etc.

Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_price_field()

Validate Price Field.

public validate_price_field( $key : string , $value : string ) : string

Make sure the data is escaped correctly, etc.

Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_decimal_field()

Validate Decimal Field.

public validate_decimal_field( $key : string , $value : string ) : string

Make sure the data is escaped correctly, etc.

Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_password_field()

Validate Password Field. No input sanitization is used to avoid corrupting passwords.

public validate_password_field( $key : string , $value : string ) : string
Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_textarea_field()

Validate Textarea Field.

public validate_textarea_field( $key : string , $value : string ) : string
Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_checkbox_field()

Validate Checkbox Field.

public validate_checkbox_field( $key : string , $value : string ) : string

If not set, return "no", otherwise return "yes".

Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_select_field()

Validate Select Field.

public validate_select_field( $key : string , $value : string ) : string
Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string

validate_multiselect_field()

Validate Multiselect Field.

public validate_multiselect_field( $key : string , $value : string ) : string|array
Parameters
$key : string

Field key.

$value : string

Posted Value.

Return values
string|array

validate_settings_fields()

Validate the data on the "Settings" form.

public validate_settings_fields( [ $form_fields : array = array() ] ) : mixed
Parameters
$form_fields : array = array()

Array of fields.

Tags
deprecated

No longer used.

Return values
mixed

format_settings()

Format settings if needed.

public format_settings( $value : array ) : array
Parameters
$value : array

Value to format.

Tags
deprecated

Unused.

Return values
array
Back to the top