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
Email Task Description variable (Read 7404 times)
YorkieBar
YaBB Newbies
*
Offline



Posts: 18
Email Task Description variable
Mar 10th, 2010 at 6:05pm
 
I'm using the %WD_CONFIG% variable in emails but would like to include more user friendly information about the contents of the email.

Is the short description entered on the last tab available as a variable?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #1 - Mar 11th, 2010 at 7:33am
 
Hi,

It is not available, currently. Also, I hesitate to add it because this is a multiline field. The %WD_xxx% variables are also used for Batch scripts and this can cause problems in those scripts....

An alternative you can use (see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html ):
add this to your email body:

[code]@@@C:\BodyTexts\%WD_CONFIG%.txt@@@[/code]

(see "Enter the message body" on http://www.watchdirectory.net/wdhelp/plugins/wdopAutoEmail.html )

and create text files in C:\BodyTexts with the text you want to include. Note that those texts should be stored on a local drive (C:), not on the network.

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
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #2 - Mar 11th, 2010 at 9:47am
 
You can even do

Code:
@@@C:\BodyTexts\%WD_CONFIG%_%WD_REASON%.txt@@@ 



where WD_REASON is replaced by FILENEW, FILECHNG etc. So you have different texts depending on the event.
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
 
YorkieBar
YaBB Newbies
*
Offline



Posts: 18
Re: Email Task Description variable
Reply #3 - Mar 11th, 2010 at 9:52am
 
Part of what I'm trying to do is to reduce the 6 email tasks I currently have to a single job so would prefer the BodyText file to be in the same directory as the files to be emailed.The %WD_CONFIG% is therefore the same name for each email.
I have the @@email.txt file in a unique directory on the server for each type of message already. It would keep the data in one place and make maintenance easier if the BodyText file was there as well.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #4 - Mar 11th, 2010 at 10:01am
 
Here is one little secret (it should probably be documented).

If you use the @@email.txt trick (see Advanced Addressing at http://www.watchdirectory.net/wdhelp/plugins/email_addressing.html ), you can also add a subject (not message body) to the email.txt. This subject will be used instead of the subject you configured for the email task.

To get a subject based on the directory where the files are detected, add the following 2 lines at the bottom (!!!!!!!) of the list of email addresses:
Code:
[subject]
subject=My subject for those recipients 



Again, please make sure the above 2 lines are at the bottom of the file.
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
 
YorkieBar
YaBB Newbies
*
Offline



Posts: 18
Re: Email Task Description variable
Reply #5 - Mar 11th, 2010 at 10:59am
 
Are variables allowed in this subject line?
Also - Could an option for the future be adding Body Text lines here as well?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #6 - Mar 11th, 2010 at 11:10am
 
Currently not (variables and body text).

But both are good ideas, I will add them to our "to do/to investigate" list.

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
 
YorkieBar
YaBB Newbies
*
Offline



Posts: 18
Re: Email Task Description variable
Reply #7 - Mar 11th, 2010 at 12:01pm
 
Two new files similar to @@email.txt

e.g. @@subject.txt and @@bodytext.txt

both allowing full use of the existing WD variables would suit my needs.

Thank for the help - I'll leave my plan to consolidate email tasks into one until another time.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #8 - Mar 11th, 2010 at 12:13pm
 
mmmm, that won't work.
"email.txt" is just an example filename, it could be anything (including subject.txt etcetera, email.txt is just an example name).

Ok, the subject is already configurable, described above.

[blackmail mode on]
If you help my friend Vladimir who is looking for help for a friends' son with cancer, I will make sure you can also include body-text in "email.txt" in the next release. Not sure if I can include variables, I will check if it is easy to include. For Vladimir's quest, please see:
http://www.datalandsoftware.com/blog/2010/02/28/please-help-little-andrew-and-ge...
and
http://watchdirftp.blogspot.com/2010/02/do-you-want-to-help-little-boy-with.html
and
http://watchdirftp-de.blogspot.com/2010/03/25-rabatt-fur-eine-kleine-spende.html
[blackmail mode off]

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
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #9 - Mar 11th, 2010 at 12:46pm
 
Paul understands how to influence our release schedule Wink

Thank you for your help for little Andrej, Paul.

I better start my editor/compiler now.

Gert
http://watchdirftp.blogspot.com/2010/02/do-you-want-to-help-little-boy-with.html
...
Back to top
« Last Edit: Mar 11th, 2010 at 8:46pm by Gert »  

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
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #10 - Mar 14th, 2010 at 4:26pm
 
Just released version 4.6.2 which allows you to "override" the subject and message body:

http://www.watchdirectory.net/wdhelp/help/wdcc_version_history.html
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
 
YorkieBar
YaBB Newbies
*
Offline



Posts: 18
Re: Email Task Description variable
Reply #11 - Mar 18th, 2010 at 1:44pm
 
Thanks Gert  Smiley  The new option works very well.
I'm using it to monitor 10 main directories and a 4 level deep set of dynamic named sub directories.
Whereever I need a special set of addresses and/or subjects I place an @@email.txt file in the actual lowest level directory.
Alternatively using the ability to look upwards through the tree (using @@!email.txt) I now have personalised sender addresses etc set in higher/middle Smiley level directories. This enables me to use dynamic naming to create directories and still send personalised emails.
I have a final top level default @@email.txt file that sends me the email message, this enables me to trap any missing @@email.txt in lower directories.

Its another great WD function.

Smiley
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: Email Task Description variable
Reply #12 - Mar 18th, 2010 at 2:05pm
 
Yeah, when I sometimes visit customers (or get a support request), I am often amazed how many email tasks they have running. I guess advanced addressing is not obvious enough. I wrote a blog earlier ( http://watchdirftp.blogspot.com/2009/05/how-many-tasks-does-watchdirectory.html ) trying to explain a bit better.

Hey, being the nice guy you are Wink
Would you be interested to write a guest blogpost, describing how you use WD and, especially, the email feature? I think your experience will be a great read for other people.

Let me know (and I totally understand if you don't have time to do so),
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