如何更改发送到电子邮件地址的这封邮件中的文本的颜色和粗体?
'The coupon code "%s" has been applied by a customer'
链接到原始内容
// For all Woocommerce versions (since 3.0)
add_action( 'woocommerce_checkout_update_order_meta', 'custom_email_for_orders_with_applied_coupon' );
function custom_email_for_orders_with_applied_coupon( $order_id ){
$order = wc_get_order( $order_id );
$used_coupons = $order->get_used_coupons();
if( ! empty($used_coupons) ){
foreach ( $used_coupons as $coupon_code ) {
$coupon = new WC_Coupon( $coupon_code ); // WC_Coupon Object
$recipient = $coupon->get_meta('email_recipient'); // get recipient
if( ! empty($recipient) ) {
$subject = sprintf( __('Coupon "%s" has been applied'), $coupon_code );
$content = sprintf( __('The coupon code "%s" has been applied by a customer'), $coupon_code );
wp_mail( $recipient, $subject, $content ); // Send email
}
}
}
}
我正在尝试为电子邮件回复设置css或其他样式效果
enter image description here
3条答案
按热度按时间bkkx9g8r1#
你试过HTML吗?你可以像这样添加内联css:
<span style="color:red">word</span>
如果HTML主体不是
wp_mail
的默认值(实际情况如此),则应添加以下标题:3wabscal2#
更改此行:
致:
hmae6n7t3#
更改此内容:
对此: