本文整理匯總了PHP中WC_Email::style_inline方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Email::style_inline方法的具體用法?PHP WC_Email::style_inline怎麽用?PHP WC_Email::style_inline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WC_Email
的用法示例。
在下文中一共展示了WC_Email::style_inline方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: email_template
public static function email_template($subject, $message)
{
global $woocommerce, $woocommerce_settings;
// load the mailer class
$mailer = WC()->mailer();
$email_heading = $subject;
$message;
$abstractClass = new ReflectionClass('WC_Email');
if (!$abstractClass->isAbstract()) {
$email = new WC_Email();
// wrap the content with the email template and then add styles
$fetch_data = $email->style_inline($mailer->wrap_message($email_heading, $message));
} else {
$fetch_data = $mailer->wrap_message($email_heading, $message);
}
return $fetch_data;
}
示例2: preview_emails
/**
* Preview email template.
*
* @return string
*/
public function preview_emails()
{
if (isset($_GET['preview_woocommerce_mail'])) {
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'preview-mail')) {
die('Security check');
}
// load the mailer class
$mailer = WC()->mailer();
// get the preview email subject
$email_heading = __('HTML Email Template', 'woocommerce');
// get the preview email content
ob_start();
include 'views/html-email-template-preview.php';
$message = ob_get_clean();
// create a new email
$email = new WC_Email();
// wrap the content with the email template and then add styles
$message = apply_filters('woocommerce_mail_content', $email->style_inline($mailer->wrap_message($email_heading, $message)));
// print the preview email
echo $message;
exit;
}
}