Code: Select all
local domain = "%Domain"
local username = "%Name"
local weblink = "%WebLink"
local filename = "%FileName"
local client_ip = "%IP"
if username == "<WEBLINK>" then
local result = c_ExecuteSQL("select f_email from wftp_weblink where f_domain='"..domain.."' and f_is_uplink=0 and f_weblink='"..weblink.."' limit 1")
if result[1] ~= nil and result[1][0] ~= "" then
local arrEmail = Split(result[1][0], "|")
if table.maxn(arrEmail) == 2 and arrEmail[2] ~= "" then
local notifyEmail = arrEmail[2]
c_SendMail(notifyEmail, "File downloaded via weblink "..weblink, "Client "..client_ip.." downloaded the file '"..filename.."'.", "", "SMTP_CONFIG")
end
end
end
![Image](https://www.wftpserver.com/bbsres/weblink_event.png)
Then you can login the web client and create Weblink for an existed file, just check on the option "Send email to" and input the recipient's email address, and specify the originator's email address in the filed "My email address".
So when the recipient downloads the weblink file, an email notification will be sent to the originator.
![Image](https://www.wftpserver.com/bbsres/download_notify.png)