Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


andrew
2013-04-17T14:57:36Z
Trying to set up a job to check an email account for a particular subject line message, retrieve an attachment and save the file to a known destination. It seems the imap functionality for retrieving email file attachments is available in trigger functionality, but not as a task.

I'm having difficulty with VC's handling of attachments in the email trigger and have a few questions:


1.) In an email trigger if I select "save attachments always" and specify a directory where the file should be saved then, upon retrieving the attachment, VisualCron makes a new sub directory (named 1, 2, 3 etc) for each email it processes. The filenames of every attachment are already unique. Why does VisualCron do this and how are subsequent tasks supposed to do further processing on the saved attachments (e.g. unzip etc) if the exact location of the files are not known. In addition, this creates a maintenance headache as the unnecessary proliferation of sub directories need to be emptied and pruned. A nice to have feature would be to archive the email on the email server. It seems the iMap trigger allows this -- I don't understand the thinking behind the architecture of VisualCron well enough to understand why this imap functionality is not available in a task. I am inclined to view triggers as condition checkers (e.g. see if an email has arrived) and tasks as operations that perform work such as downloading and saving attachments, archiving emails on the imap email server etc.


2.) I'd like the email account checked for a particular email, but not until a certain time of day. It would be very helpful to have a paragraph or two or a few screenshots as to how to set up a time trigger that starts an email checker -- I don't want to poll the email server all day, just after a certain time of day.

I'd appreciate any suggestions.

Warm regards,

Andrew


Sponsor
Forum information
Support
2013-04-18T08:54:50Z
Hi Andrew,

1. the reason behind this is that the email Trigger download and treats all emails as unique. We want it to be clear which attachment belonged to which email. Also, if attachments where saved to the same folder they would overwrite each other if same attachments comes in two emails.

Triggers starts a Job while Tasks performs actions within a Job. That is the main difference.

What you can do is to keep your Job with the Email Trigger. Then add a second Job with a File Trigger that monitors that base folder you have specified (and its sub folders). You can learn how to use that and Variables which are needed to work with the specific file and folder in subsequent Tasks when the new file has been found - in this File Trigger Tutorial: http://www.visualcron.com/Tutorials.aspx 

2. What is the reason why you do not want to do that? You can increase the interval if the problem is that you do not want to "push it to hard".
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
andrew
2013-04-18T14:59:48Z
Dear Henrik,

Thank you for your help. I can see why you might want to have some way to associate saved email attachments with particular emails. It would be really great if the more usual (IMHO) simple and easier to manage scenario were available: i.e. to save the attachment file in the specified location and not proliferate all sorts of nested numbered subdirectories that then have to me emptied and pruned on a regular basis.

In our experience the most common procedure for email attachment handling is: to save the attachment file to a fixed location, rename or add a timestamp to the filename as desired, archive the email, process the file contents (unzip, upload to database etc). Upon conclusion of processing the attachment contents the file is typically moved to an archive directory.

As for my original #2 question regarding delaying polling the email server till a certain time -- a great deal of our daily processing occurs after the close of the financial markets and thus, for us, there is no reason to bang on the servers all day.

The lack of an option for more simple handling of email attachment file destinations is not a show-stopper for us, but does add additional maintenance steps (e.g. pruning the proliferation of subdirectories). From a reliability standpoint, folks say that more steps yield more potential failure points. Of course you and I never have bugs in our code so we're not personally familiar with that concept ;)


Again, thanks for your help and excellent support. We're all very pleased with both the product and your support.

Warm regards,

Andrew
Support
2013-04-18T15:04:44Z
You can still choose when to pickup the files. The suggested solution with a file trigger on the second Job was only if you wanted to handle the files right away. If you want to do this a certain time you keep your Email Trigger Job but create a second, time schedule Job, with a List files Task. This can list files based on name, date etc.

The Task will then fill the output with the paths to the found files. You can then create a loop around a second or more Task to process each of these files one by one.

Check out the video about the loop tutorial and let us know if you need more help!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2013-04-22T17:17:30Z
Henrik,

I have not yet tried yet but can sometime this week... If you do a File Trigger, or e-mail trigger, any sort of EVENT trigger, can you use the 'Time Exceptions' option to prevent it from watching during those times?

So, say I have a file that should come in sometime between 4pm and 6pm, I need it processed immediately, but don't want to run the job/task with a condition every minute or so between 4 and 6. Can I add an Time Exception that includes all other hours of the day except for 4pm-6pm and it'll stop the file trigger from polling until its between the 4-6pm timeframe? Or does that only take effect for the Time Triggers?

Brian
Support
2013-04-23T07:35:02Z
Time exceptions will definitely prevent it from Triggering but what might be a problem is that you are then ignoring the particular file that Triggered. And that event will not fire again.

It just might seem better to have a normal time trigger when you want to check for files and when using that use the List files Task to pickup all the files found.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top