Properties

$instance

$instance : mixed

Private static variable to hold the single instance of the class.

Type

mixed — Default null.

Methods

get_class_name()

get_class_name() : string

Get class name.

Returns

string —

Class name.

instance()

instance() : mixed

Create a new self instance.

Returns

mixed —

self::$instance

__construct()

__construct() 

MainWP_Notification_Settings constructor.

Run each time the class is called.

emails_general_settings_handle()

emails_general_settings_handle() : boolean

Manage general email settings.

Returns

boolean —

True if saved successfully, false if not.

render_all_settings()

render_all_settings(boolean  $updated) 

Render all email settings options.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

boolean $updated

True if page loaded after update, false if not.

render_edit_settings()

render_edit_settings(string  $type, boolean  $updated_templ) 

Render email settings page.

Credits.

Plugin-Name: WooCommerce. Plugin URI: https://woocommerce.com/. Author: Automattic. Author URI: https://woocommerce.com. License: GPLv3 or later.

Parameters

string $type

Email notification type.

boolean $updated_templ

True if page loaded after update, false if not.

get_settings_desc()

get_settings_desc(string  $type) : string

Get email settings description.

Parameters

string $type

Email notification type.

Returns

string —

$email_description Email settings Description.

render_update_template_message()

render_update_template_message(integer  $updated) 

Render the notification after the update process.

Parameters

integer $updated

Update code (copied, saved or deleted).

get_notification_types()

get_notification_types(string  $type = '') : mixed

Get email notification types.

Parameters

string $type

Email notification type.

Returns

mixed —

Notification types.

get_general_email_settings()

get_general_email_settings(string  $type) : array

Get general email notifications settings.

Parameters

string $type

Email type.

Returns

array —

An array containing the email settings.

get_general_email()

get_general_email() : string|\MainWP\Dashboard\empty

Get general notification email.

Returns

string|\MainWP\Dashboard\empty —

recipients.

update_general_email()

update_general_email(string  $emails) : void

Update general notification email.

Parameters

string $emails

Emails.

get_site_email_settings()

get_site_email_settings(string  $type, object  $website) : array

Get email settings for a single site.

Parameters

string $type

Email type.

object $website

Object containing the child site information.

Returns

array —

An array containing the email settings.

get_default_emails_fields()

get_default_emails_fields(string  $type, string  $field = '', boolean  $general = false) : array|string

Get default email notifications values.

Parameters

string $type

Email type.

string $field

Field name.

boolean $general

General or individual site settings.

Returns

array|string —

Email field settings value.

replace_tokens_for_settings()

replace_tokens_for_settings(array  $options, array  $fields, object  $website) : array

Replace site tokens for settings.

Parameters

array $options

array of fields to find and replace tokens.

array $fields

fields names to find.

object $website

The website.

Returns

array —

$options array of fields.

replace_tokens_for_content()

replace_tokens_for_content(string  $content, object  $website) : string

Replace site tokens for content.

Parameters

string $content

content to find and replace tokens.

object $website

The website.

Returns

string —

$content after replaced tokens.