• I am using WP Download Manager Pro and I have added the code below so that I receive an email notification after a file is downloaded. The email, however, just sends me the IP address of the person downloading. I’d like to have it changed it s it sends me the email and/or name of the person after downloading.

    I want this for a special content protected area where the users already have a name and email. These downloads are under a specific category, i,e, ‘top secret’.

    Would anyone happen to know how the code below can be modified?

    —————

    function download_notification($package){
    $package_data = get_post($package[‘ID’]);
    $headers = ‘From: Site Name ‘ . “\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(“before_download”, “download_notification”);

  • The topic ‘WP Download Manager & email notification after’ is closed to new replies.