# Send Low and Out-of-Stock Alerts to Your Buyer

> Sends WooCommerce low stock and out-of-stock notifications to a purchasing or inventory address instead of the store admin.

- Type: PHP
- Runs: Run everywhere
- Category: [Email](https://wpide.com/library/category/email/)
- Requires: WooCommerce
- Tags: email, woocommerce, stock, inventory
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/email-woo-stock-alert-recipient/

## Code

```php
$wpide_stock_alert_to = ''; // For example 'purchasing@yourdomain.com'.

add_filter( 'woocommerce_email_recipient_low_stock', function ( $recipient ) use ( $wpide_stock_alert_to ) {
    return is_email( $wpide_stock_alert_to ) ? $wpide_stock_alert_to : $recipient;
} );

add_filter( 'woocommerce_email_recipient_no_stock', function ( $recipient ) use ( $wpide_stock_alert_to ) {
    return is_email( $wpide_stock_alert_to ) ? $wpide_stock_alert_to : $recipient;
} );
```

## Notes

Set $address. Leave it empty to keep the default recipient.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Send Low and Out-of-Stock Alerts to Your Buyer" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
