本文整理汇总了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);
}