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

You can share your Lua Scripts with everybody here.

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

Postby achase » Wed Apr 23, 2014 10:09 pm

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
achase
 
1
 
Wed Apr 23, 2014 10:01 pm

Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 2 guests