public function send($to, $subject, $message, $data = array()) { $send_method = $this->get_send_method($this->get_db_settings_option('method')); if (!$send_method) { return array('status' => 0, 'message' => __('Invalid send method', 'fw')); } if (is_wp_error($send_method_configuration = $send_method->prepare_settings_options_values($this->get_db_settings_option($send_method->get_id())))) { return array('status' => 0, 'message' => $send_method_configuration->get_error_message()); } $email = new FW_Ext_Mailer_Email(); $email->set_to($to); $email->set_subject($subject); $email->set_body($message); $result = $send_method->send($email, $this->get_db_settings_option($send_method->get_id()), $data); return is_wp_error($result) ? array('status' => 0, 'message' => $result->get_error_message()) : array('status' => 1, 'message' => __('The message has been successfully sent!', 'fw')); }