本文整理匯總了PHP中WC_Email::send方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Email::send方法的具體用法?PHP WC_Email::send怎麽用?PHP WC_Email::send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WC_Email
的用法示例。
在下文中一共展示了WC_Email::send方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendEmail
public function sendEmail($post)
{
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$subject = apply_filters('woocommerce_email_subject_gift_card', sprintf('[%s] %s', $blogname, __('Gift Card Information', 'rpgiftcards')), $post->post_title);
$sendEmail = get_bloginfo('admin_email');
$headers = array('Content-Type: text/html; charset=UTF-8');
ob_start();
$mailer = WC()->mailer();
$email = new WPR_Giftcard_Email();
echo '<style >';
wc_get_template('emails/email-styles.php');
echo '</style>';
$email_heading = __('New gift card from ', 'rpgiftcards') . $blogname;
$email_heading = apply_filters('rpgc_emailSubject', $email_heading);
$toEmail = wpr_get_giftcard_to_email($post->ID);
$theMessage = $email->sendGiftcardEmail($post->ID);
$theMessage = apply_filters('rpgc_emailContents', $theMessage);
echo $mailer->wrap_message($email_heading, $theMessage);
$message = ob_get_clean();
$attachment = '';
$email = new WC_Email();
$email->send($toEmail, $subject, $message, $headers, $attachment);
}
示例2: send
/**
* Send the email.
*
* @param mixed $to
* @param mixed $subject
* @param mixed $message
* @param string $headers (default: "Content-Type: text/html\r\n")
* @param string $attachments (default: "")
* @return bool
*/
public function send($to, $subject, $message, $headers = "Content-Type: text/html\r\n", $attachments = "")
{
// Send
$email = new WC_Email();
return $email->send($to, $subject, $message, $headers, $attachments);
}