diff --git a/class/class-mainwp-child-branding.php b/class/class-mainwp-child-branding.php index 861c780..529d8b6 100644 --- a/class/class-mainwp-child-branding.php +++ b/class/class-mainwp-child-branding.php @@ -793,13 +793,15 @@ class MainWP_Child_Branding { public function send_support_mail() { $email = $this->child_branding_options['support_email']; $sub = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_subject'] ) ) ); + $from = trim($_POST['mainwp_branding_contact_send_from']); $subject = !empty( $sub ) ? $sub : "MainWP - Support Contact"; $content = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_content'] ) ) ); $mail = $headers = ''; if ( ! empty( $_POST['mainwp_branding_contact_message_content'] ) && ! empty( $email ) ) { global $current_user; $headers .= "Content-Type: text/html;charset=utf-8\r\n"; - //$headers .= "From: \"" . $current_user->user_email . "\" <" . $current_user->user_email . ">\r\n"; + if (!empty($from)) + $headers .= "From: \"" . $from . "\" <" . $from . ">\r\n"; $mail .= "
Support Email from: " . site_url() . "
\r\n\r\n"; $mail .= "Sent from WordPress page: " . ( ! empty( $_POST["mainwp_branding_send_from_page"] ) ? "" . esc_url( $_POST["mainwp_branding_send_from_page"] ) . "
\r\n\r\n" : "" ); $mail .= "Client Email: " . $current_user->user_email . "
\r\n\r\n"; @@ -817,6 +819,7 @@ class MainWP_Child_Branding { } function contact_support() { + global $current_user; ?>