WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Using the detected file as the body of an email
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1290594881

Message started by YorkieBar on Nov 24th, 2010 at 11:34am

Title: Using the detected file as the body of an email
Post by YorkieBar on Nov 24th, 2010 at 11:34am
I'm testing out the function @@@%WD_FILE%@@@ which I understand will use the contents of the detected file as the body of the email message.
I'm getting an error of "The file test.csv can not be read!"

I am using an external email.txt file to address the emails with the @@!email.txt option.
Normally when the body text in @@!email.txt is empty the body text comes from the email Plugin itself. It's here that I entered @@@%WD_FILE%@@@.

Are there any restrictions on this function?

Title: Re: Using the detected file as the body of an emai
Post by Gert on Nov 25th, 2010 at 7:53am
Is this detected file located on the network?
Currently it is the wdPostman program that processes those @@@ files and by default it has no access to the network.

Title: Re: Using the detected file as the body of an emai
Post by YorkieBar on Nov 25th, 2010 at 11:06am
Yes - The sub-directory I want to use is part of a large network based directory.

Title: Re: Using the detected file as the body of an emai
Post by Gert on Nov 26th, 2010 at 6:28am
Currently you need to allow the wdPostman service to access the network for this to work.
See "Change the User for the WatchDirectory Service" at the bottom of this post: http://watchdirftp.blogspot.com/2010/04/watchdirectory-tasks-as-windows-service.html

Note that the post talks about WatchDirectory tasks ("watchDirectory:TheNameOfYourWatchDirectoryTask"), you need to change the Windows service "wdPostman" instead.

I will change the processing of @@@%WD_FILE%@@@ so a future release will let the WD task read the file, instead of the wdPostman program. As the task is already properly configured to access the network that should work better.

Title: Re: Using the detected file as the body of an emai
Post by YorkieBar on Nov 26th, 2010 at 1:30pm
I've changed the service to run with an Admin account but the error message is the same. If i put the detected file on the local drive it does work as i want it.

Title: Re: Using the detected file as the body of an emai
Post by Gert on Nov 26th, 2010 at 3:24pm
Have a look at the task that is detecting the file (the one creating the emails). If you configure the wdPostman service to use the same user/password it should work.

Title: Re: Using the detected file as the body of an emai
Post by YorkieBar on Nov 26th, 2010 at 4:18pm
The email task isn't a service. All my tasks run as separate tasks under an Admin account on a virtual XP Pro PC rather than services. The WdPostman service uses the same Admin account and password.

Title: Re: Using the detected file as the body of an emai
Post by Gert on Nov 26th, 2010 at 4:30pm
Ah, ok.

Just guessing here, but your WD task is monitoring a mapped drive (X:\somedirectory), not a share (\\server\share\somedirectory)?

In that case the %WD_FILE% variable will expand to
X:\somedirectory\newfile.txt

Problem here is that the X: drive will not be mapped for the wdpostman service....

For the moment (while the @@@filename@@@ processing is done by wdpostman) you can solve this issue by running wdPostman as a "normal program" as well. That way, it will have the same drive mappings as your tasks.

  • Select the menu View -> Email -> Automatically Start/Stop....
  • If prompted, tell it to disable the Windows Service for the wdPostman process
  • Select the menu View -> Email -> Automatically Start/Stop.... again
  • Tell it to run from the Startup menu instead



WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.