# Email Alert for Large Donations (GiveWP)

> Emails your fundraising team as soon as a donation at or above a set amount is completed, so major donors can be thanked personally the same day.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: givewp, donations, email
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/give-large-donation-alert/

## Code

```php
$wpide_threshold = 500;                     // Amount that triggers the alert.
$wpide_notify_to = get_option( 'admin_email' ); // Recipient(s).

add_action( 'give_complete_donation', function ( $donation_id ) use ( $wpide_threshold, $wpide_notify_to ) {
    if ( ! function_exists( 'give_donation_amount' ) ) {
        return;
    }

    $amount = (float) give_donation_amount( $donation_id );

    if ( $amount < $wpide_threshold ) {
        return;
    }

    $form_id = function_exists( 'give_get_payment_form_id' ) ? give_get_payment_form_id( $donation_id ) : 0;
    $email   = function_exists( 'give_get_payment_user_email' ) ? give_get_payment_user_email( $donation_id ) : '';

    wp_mail(
        $wpide_notify_to,
        sprintf( 'Large donation received: %s', html_entity_decode( wp_strip_all_tags( give_currency_filter( give_format_amount( $amount, array( 'sanitize' => false ) ) ) ) ) ),
        sprintf(
            "Donation #%1\$d\nAmount: %2\$s\nForm: %3\$s\nDonor email: %4\$s\nView: %5\$s\n",
            $donation_id,
            $amount,
            $form_id ? get_the_title( $form_id ) : '-',
            $email,
            admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . (int) $donation_id )
        )
    );
} );
```

## Notes

Set $wpide_threshold in your site currency and $wpide_notify_to.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Email Alert for Large Donations (GiveWP)" 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/
