Docs / Action Reference / wpdm_onstart_download

wpdm_onstart_download

You can use wpdm_onstart_download action to do something just before start download.

Example

You can use the following code to send email notification before someone downloads a package

<?php
function download_notification( $package ) {
    $package_data = get_post( $package['ID'] );
    $headers      = 'From: Site Name <noreply@sitename.com>' . "\r\n";
    $headers      .= 'Content-type: text/html' . "\r\n";
    $message      = "Downloader's IP: " . $_SERVER['REMOTE_ADDR'];
    wp_mail( get_option( "admin_email" ), "Download Notification: " . $package_data->post_title, $message, $headers );
}

add_action( "wpdm_onstart_download", "download_notification" ); 
?>

 

Last updated on January 26, 2026

Need Help?

Get support from our team or community forum.

Visit Support

Customization

Need custom features? We can help.

Request Quote