/** * Triggers instock notification email to each user on the waitlist for a product, then deletes the waitlist * * @param int $post_id * @access public * @return void */ public function waitlist_mailout($post_id) { if (!empty($this->waitlist)) { if ('yes' == get_option('woocommerce_waitlist_archive_on')) { $this->archive_waitlist_before_mailouts($post_id); } global $woocommerce; $woocommerce->mailer(); foreach ($this->waitlist as $user_id) { $user = get_user_by('id', $user_id); if (!WooCommerce_Waitlist_Plugin::automatic_mailouts_are_disabled()) { do_action('woocommerce_waitlist_mailout_send_email', $user_id, $post_id); } if (WooCommerce_Waitlist_Plugin::persistent_waitlists_are_disabled()) { $this->unregister_user($user); } } } }
* * @author Neil Pie * @package WooCommerce_Waitlist/Templates/Emails/Plain * @version 1.2 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly do_action('woocommerce_email_header', $email_heading); ?> <p><?php echo _x("Hi There,", 'Email salutation', 'woocommerce-waitlist'); ?> </p> <p><?php echo sprintf(__('%1$s is now back in stock at %2$s.', 'woocommerce-waitlist'), $product_title, get_bloginfo('name')) . " "; echo __('You have been sent this email because your email address was registered on a waitlist for this product.', 'woocommerce-waitlist'); ?> </p> <p><?php echo sprintf(__('If you would like to purchase %1$s please visit the following link: <a href="%2$s">%3$s</a>', 'woocommerce-waitlist'), $product_title, $product_link, $product_link); ?> </p> <?php if (WooCommerce_Waitlist_Plugin::persistent_waitlists_are_disabled()) { echo '<p>', __('You have now been removed from the waitlist for this product.', 'woocommerce-waitlist'), '</p>'; } do_action('woocommerce_email_footer');