# Order Total and Buyer in EDD Sale Notification Subjects

> Changes the subject of the "New sale" email you receive to include the amount and the buyer's name, so you can see each sale from your inbox.

- Type: PHP
- Runs: Run everywhere
- Category: [Easy Digital Downloads](https://wpide.com/library/category/edd/)
- Requires: Easy Digital Downloads
- Tags: edd, email, notifications, admin
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/edd-admin-sale-subject/

## Code

```php
add_filter( 'edd_admin_sale_notification_subject', function ( $subject, $order_id ) {
    $order = function_exists( 'edd_get_order' ) ? edd_get_order( $order_id ) : false;

    if ( ! $order ) {
        return $subject;
    }

    $customer = edd_get_customer( $order->customer_id );
    $name     = $customer && $customer->name ? $customer->name : $order->email;

    return sprintf( 'New sale: %1$s from %2$s (#%3$s)', html_entity_decode( edd_currency_filter( edd_format_amount( $order->total ), $order->currency ) ), $name, $order->get_number() );
}, 10, 2 );
```

## Notes

Change the wording in the sprintf line; only the admin sale notification is affected.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Order Total and Buyer in EDD Sale Notification Subjects" 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/
