get_id() ), $product ); if ( 'similar' === $match_type ) { /* translators: %s: store name */ $subject = sprintf( __( 'A product similar to one you follow is now available at %s', '92-notify-for-woocommerce' ), $store_name ); /* translators: %s: product name */ $heading = sprintf( __( 'A similar product is now available: %s', '92-notify-for-woocommerce' ), $product->get_name() ); $intro = __( 'A product similar to one you subscribed to is now back in stock.', '92-notify-for-woocommerce' ); } else { /* translators: %1$s: product name, %2$s: store name */ $subject = sprintf( __( '%1$s is back in stock at %2$s', '92-notify-for-woocommerce' ), $product->get_name(), $store_name ); /* translators: %s: product name */ $heading = sprintf( __( 'Good news! %s is back in stock', '92-notify-for-woocommerce' ), $product->get_name() ); $intro = __( 'The product you were waiting for is now available.', '92-notify-for-woocommerce' ); } $subject = apply_filters( 'ninetytwo_notify_email_subject', $subject, $product, $match_type ); $heading = apply_filters( 'ninetytwo_notify_email_heading', $heading, $product, $match_type ); $unsubscribe_url = ninetytwo_notify_get_unsubscribe_url( $unsubscribe_token ); $body = ninetytwo_notify_get_email_html( $heading, $intro, $product, $product_url, $unsubscribe_url, $store_name ); $body = apply_filters( 'ninetytwo_notify_email_content', $body, $product, $match_type, $email ); $headers = array( 'Content-Type: text/html; charset=UTF-8' ); return wp_mail( $email, $subject, $body, $headers ); } /** * Builds the HTML body used for every notification email. * * @param string $heading Email heading text. * @param string $intro Short intro line under the heading. * @param WC_Product $product The product that is now available. * @param string $product_url Direct link to the product. * @param string $unsubscribe_url Secure unsubscribe link for this subscriber. * @param string $store_name Store name for the header/footer. * @return string */ function ninetytwo_notify_get_email_html( $heading, $intro, $product, $product_url, $unsubscribe_url, $store_name ) { $price_html = ''; if ( $product->get_price() !== '' ) { $price_html = '

' . wp_kses_post( wc_price( $product->get_price() ) ) . '

'; } ob_start(); ?> <?php echo esc_html( $heading ); ?>

get_name() ); ?>

·