WC_REST_Email_Settings_V4_Controller::get_email_settings_data
Get email settings data by transforming email settings into REST API format.
Method of the class: WC_REST_Email_Settings_V4_Controller{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->get_email_settings_data();
WC_REST_Email_Settings_V4_Controller::get_email_settings_data() WC REST Email Settings V4 Controller::get email settings data code WC 10.3.6
private function get_email_settings_data() {
$fields = array(
array(
'id' => 'woocommerce_email_from_name',
'label' => __( '"FROM" Name', 'woocommerce' ),
'type' => 'text',
),
array(
'id' => 'woocommerce_email_from_address',
'label' => __( '"FROM" Address', 'woocommerce' ),
'type' => 'email',
),
array(
'id' => 'woocommerce_email_reply_to_enabled',
'label' => __( 'Add "Reply-to" email', 'woocommerce' ),
'type' => 'boolean',
'description' => __( 'Use a different email address for replies.', 'woocommerce' ),
),
array(
'id' => 'woocommerce_email_reply_to_name',
'label' => __( '"Reply-to" Name', 'woocommerce' ),
'type' => 'text',
),
array(
'id' => 'woocommerce_email_reply_to_address',
'label' => __( '"Reply-to" Address', 'woocommerce' ),
'type' => 'email',
),
);
$values = array(
'woocommerce_email_from_name' => get_option( 'woocommerce_email_from_name', get_option( 'blogname' ) ),
'woocommerce_email_from_address' => get_option( 'woocommerce_email_from_address', get_option( 'admin_email' ) ),
'woocommerce_email_reply_to_enabled' => get_option( 'woocommerce_email_reply_to_enabled', 'no' ) === 'yes',
'woocommerce_email_reply_to_name' => get_option( 'woocommerce_email_reply_to_name', '' ),
'woocommerce_email_reply_to_address' => get_option( 'woocommerce_email_reply_to_address', '' ),
);
return array(
'id' => 'email',
'title' => __( 'Email design', 'woocommerce' ),
'description' => __( 'Customize the look and feel of all you notification emails.', 'woocommerce' ),
'values' => $values,
'groups' => array(
'sender_details' => array(
'title' => __( 'Sender details', 'woocommerce' ),
'description' => __( 'This is how your sender name and email address would appear in outgoing emails.', 'woocommerce' ),
'order' => 1,
'fields' => $fields,
),
),
);
}