This is what im trying to do.
A pdf is uploaded to my uploads directory. Named abc activity.pdf or abc page2.pdf
the pdf could be from different clients. so I want to pull the ABC or a certain amount of char out of the name to populate the destination #Property#
field. and rename the pdf to be the date and the file name such as Jan272011-ABC.pdf
or Jan272011-ABC2.pdf
as needed.
There are several clients so they all have there own technet\property\CLIENT
NAME\reports
area.
So the file may be abc activity.pdf and i need to compare the ABC and if there Clientname directory is ABCInc it would change the #Property#
to ABCInc. so maybe search the property directory for the Client Directory Names and compare them for the right directory?
Then I want to send them a email with the attachments wether it be 1 or more as i have in my cfmail section. I believe that one is correct to do it. Then I want a email sent to me stating who recieved a report and what the report name was. I know what i have isnt correct.
Any thought on how to accomplish this
Thanks in advance!!
<CFDIRECTORY Name="GetFiles" ACTION="List" DIRECTORY="D:\home\wwwroot\technet\Uploads\"
filter="*.*">
<CFLOOP QUERY="GetFiles">
<CFIF Type IS "File">
<cffile action="rename"
source="D:\home\wwwroot\technet\Uploads\#name#"
destination="D:\home\wwwroot\technet\#property#\reports\#DateFormat(DateAdd('d', -1, MyDateTime),'mmmm dd, yyyy')# #Name#">
</CFIF>
</CFLOOP>
<CFMAIL TO= "me@u.com"
query="get_attachments"
FROM="me@u.com"
CC="me@u.com"
server = "mail.u.com"
SUBJECT=" Activity Report">
<cfloop query="">
<cfmailparam file="#get_attachments.location#/#get_attachments.name#">
</cfloop>
Dear client,
Attached is your report for your property please contact us with any questions or concerns you may have.
Thank You
</CFMAIL>
<CFMAIL TO= "me@yahoo.com"
query="get_attachments"
FROM="me@u.com"
SUBJECT="Reports sent"
type="text">
Reports were sent to the following Clients
#clientName#
<cfloop query="">
#get_attachments.name#
</cfloop>
</CFMAIL>