WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Example of variable use in v4 email plug-in (Read 1829 times)
fivespan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Example of variable use in v4 email plug-in
Sep 22nd, 2005 at 10:52pm
 
I want to watch a folder for changes to sub-folders (not files). The email should be sent out once a day with all the changes for the previous 24 hrs.

What are the values for the plugin  "Enter the message Body" when I want to receive:

MESSAGE:

The following folders were ADDEED to the file server in the last 24hrs:
\\server\pathpart1\pathpart2\JustMadeFolder1
\\server\pathpart1\pathpart2\JustMadeFolder2
\\server\pathpart1\pathpart2\JustMadeFolder3
\\server\pathpart1\pathpart2\JustMadeFolder4
\\server\pathpart1\pathpart2\JustMadeFolder5
\\server\pathpart1\pathpart2\JustMadeFolder6
\\server\pathpart1\10000\JustMadeFolder7

The following folders were DELETED from the file server in the last 24hrs:
\\server\pathpart1\pathpart2\DeletedFolder1
\\server\pathpart1\pathpart2\DeletedFolder2

The following folders were RENAMED on the file server n the last 24hrs:
\\server\pathpart1\pathpart2\NewName1 -- OldName
\\server\pathpart1\pathpart2\NewName2 -- OldName

------

Any ideas for me?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: Example of variable use in v4 email plug-in
Reply #1 - Sep 24th, 2005 at 11:39am
 
Hello "Fivespan",

The email plugin does not support this directly, but you can use the .bat file plugin (http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html) to script a solution.

Create a .bat file like this:
Code:
:DIRNEW
echo ADDED %WD_FILE% >> C:\Temp\diractivity.txt
GOTO :EOF
:DIRDEL
echo REMOVED %WD_FILE% >> C:\Temp\diractivity.txt
GOTO :EOF
:DIRREN
echo RENAMED %WD_FILE% - %WD_OFILE_N% >> C:\Temp\diractivity.txt
GOTO :EOF
 



and let WD run it for "directory events" (http://www.watchdirectory.net/wdhelp/help/wdnewconfigpage4.html).

Create another .bat file that sends the diractivity.txt file, containing
Code:
set EMAILFILE=C:\Documents and Settings\All Users\Application Data\watchDirectory\System.Mail\Out\TTT.TMP
echo this is the subject > "%EMAILFILE%"
echo John Doe^<j.doe@johndoe.com^> >>  "%EMAILFILE%"
echo. >> "%EMAILFILE%"
echo. >> "%EMAILFILE%"
echo c:\temp\diractivity.txt >> "%EMAILFILE%"
echo pecunia non olet >> "%EMAILFILE%"
echo Hello, >> "%EMAILFILE%"
echo Please find attached the file with changes >> "%EMAILFILE%"
rem okay, the script is created, now rename it so the wdPostMan program processes it.
ren "%EMAILFILE%" TTT.wdmail
 



See http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEmail.html for an explanation of this script.

This "send email script" should not be run by WD, but scheduled by the windows scheduler to run once a day.

Hope this helps,
Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1