mailer();
if ( class_exists( 'WC_SC_Email_Coupon' ) ) {
$email_coupon = new WC_SC_Email_Coupon();
$email_args = array(
'coupon' => array(
'code' => $coupon_code,
'amount' => 0,
),
);
$email_coupon->email_args = wp_parse_args( $email_args, $email_coupon->email_args );
$email_coupon->set_placeholders();
$email_content = $email_coupon->get_content();
// Replace placeholders with values in the email content.
$email_content = ( is_callable( array( $email_coupon, 'format_string' ) ) ) ? $email_coupon->format_string( $email_content ) : $email_content;
ob_start();
wc_get_template( 'emails/email-styles.php' );
$css = ob_get_clean();
$css = apply_filters( 'woocommerce_email_styles', str_replace( '"', "'", $css ), $email_coupon );
ob_start();
echo '
'; // phpcs:ignore
echo $email_content; // phpcs:ignore
echo ob_get_clean(); // phpcs:ignore
}
}
?>