orderMailHtml($mailArr); $headers = 'From: "' . get_bloginfo('name') . '" ' . "\r\n" . 'Content-type: text/html'; wp_mail(Hotel_Content::getSetting('notify_email'), get_bloginfo('name') . ' / New Message', $htmlMail, $headers); } private function orderMailHtml($arr) { $html = ''; $html .= '

' . get_bloginfo('name') . ' / New Message

'; foreach ($arr as $e) { if ($e[0] == 'text') { $html .= '

' . $e[1] . '

'; } else if ($e[0] == 'header') { $html .= '

' . $e[1] . '

'; } else { $html .= '

' . '' . $e[0] . '' . '' . $e[1] . '' . '

'; } } require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'); $filesystem = new WP_Filesystem_Direct(array()); $mail_path = __DIR__ .'/../_mail_structure.html'; $htmlStructure = $filesystem->get_contents($mail_path); $html = str_replace('{{content}}', $html, $htmlStructure); return $html; } }