You can use this add-on to do something just before start download.

Example

You can us following code to send email notification before some download an item

 

<?php 
function download_notification($package){
    $package_data = get_post($package['ID']);
    $headers = 'From: Site Name <noreply@sitename.com>' . "rn";
    $headers .= 'Content-type: text/html' . "rn";
    $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: Jun 4, 2016


Leave a Reply