Page 1 of 1

Custom Email Address by certain Dir/User by looking in a fil

Posted: Wed Apr 23, 2014 10:09 pm
by achase
Hello,

I'm looking for the ability to search by username and folder path against a SQL database or an Excel file and find the correct email to send each time. The reasoning is we have multiple folders for outside agencies and their emails constantly change.

Our current code is only set up to send for an email hard coded into the code. Below is a sample of the code that we have.

Code: Select all

local filepath = "%PathName"
local username = "%Name"
    
if username == "aa" and string.find(filepath,"d:/FolderA") then 
   c_SendMail("xxx@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG") 
elseif username == "bb" and string.find(filepath,"d:/FolderB") then 
   c_SendMail("yyy@test.com","a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG") 
elseif username == "cc" and string.find(filepath,"d:/FolderC") then 
   c_SendMail("zzz@test.com","a file has been uploaded","%Name uploaded into  %PathName","","SMTP_CONFIG") 
end
Thank you