public function trigger($recipient, $subject, $content, $attachment = array()) { /* global $woocommerce; */ $mail = new WC_Emails(); $email_heading = get_bloginfo('name'); ob_start(); $mail->email_header($email_heading); $message = ob_get_clean(); $message .= $content; ob_start(); $mail->email_footer(); $message .= ob_get_clean(); $mail->send($recipient, $subject, $message, "Content-Type: text/html\r\n", $attachment); }
/** * Send an email * * @param Email $email * @param string $recipient * * @return bool */ public function send(Email $email, $recipient) { $wc_emails = new \WC_Emails(); return $wc_emails->send($recipient, $email->get_subject(), $email->get_content()); }