add_action("wpdm_before_email_download_link", "your_function", 10, 2);
function your_function($post, $package){
$package_data = get_post( $package['ID'] );
$headers = 'From: Site Name <noreply@sitename.com>' . "\r\n";
$headers .= 'Content-type: text/html' . "\r\n";
// Set the time zone to Asia/Singapore
date_default_timezone_set('Asia/Singapore');
$current_date_time = date('Y-m-d h:i:s A');
$message = '<html><body>';
$message .= '<table style="border: 1px solid #ccc; background-color: #f5f5f5; border-collapse: collapse;">';
$message .= '<tr><td style="font-weight: bold; border: 1px solid #ccc;">Downloader Name:</td><td style="border: 1px solid #ccc;">' . $post['name'] . '</td></tr>';
$message .= '<tr><td style="font-weight: bold; border: 1px solid #ccc;">Downloader Email:</td><td style="border: 1px solid #ccc;">' . $post['email'] . '</td></tr>';
$message .= '<tr><td style="font-weight: bold; border: 1px solid #ccc;">Package Title:</td><td style="border: 1px solid #ccc;">' . $package_data->post_title . '</td></tr>';
$message .= '<tr><td style="font-weight: bold; border: 1px solid #ccc;">Downloader\'s IP:</td><td style="border: 1px solid #ccc;">' . $_SERVER['REMOTE_ADDR'] . '</td></tr>';
$message .= '<tr><td style="font-weight: bold; border: 1px solid #ccc;">Downloaded Time:</td><td style="border: 1px solid #ccc;">' . $current_date_time . '</td></tr>';
$message .= '</table>';
$message .= '</body></html>';
wp_mail(get_option("admin_email"), "Potential Leads - Visitor downloaded a file from the NSW website.", $message, $headers);
}
Hi thanks for your guidance im able to use your code to modify it helps alot.
This code above already works flawlessly, i have change to wpdm_before_email_download_link but i wanted to add “company” using advanced customfield. it didnt work, i wanted to add extra 1 info to the email notification.
however i use the following code to add “company” it seems doesnt work:
$company = wpdm_acf([acf_EmailLock_Company], 'EmailLock/Company');
$message .= "Company: " . $custom_data . "<br>";
not sure how to add that in.. could you guide me?
Hi, im trying to add custom field “company” into the email notification
it doenst work. the code i copy to put on my $message is wpdm_acf([ID],’EmailLock/Company’
can you guide me?
what if i wanted to add “Name” and “company” (made with custom_form_fields)” as following the email notification came empty
$message .= "Name: " . $post['name'] . "<br>";
$message .= "Company: " . $custom_data . "<br>";
these 2 fields info doenst send to my email.
is my code wrong?
R u able to provide me guidance to do this?
Thank man.. didnt know it was that simple.
hi it doesnt work
can u give an example of it?
does this protect from hotlinks?
Hi is the WordPress Download Manager Special Pack included this WPDM webhook? i have to buy that separated?
one of our client still reported going into spam folder.
i suspect is the SPF record problems.
https://app.screencast.com/nWF3itISf2Ms4
how to I make it pass?
what should i do? how to adjust?
no i wanted to hide it from the public not specific user only..am I able to do it?