Calculation or script help - Scheduling over a variable time frame
Have a database which among other things sends out emails to clients. Currently the emails are manually scheduled to be sent out in an even distribution over a variable length of time. What I would like to do is automatically calculate when the emails would be sent out equally distributing them over a variable length of time.
I have Clients and Tips tables. The client table has a "date of travel" field and the tips table has multiple "send on date" fields that are manually populated with a date to evenly distribute the documents that are sent out as attachments to emails. Currently, with the manually populated "send on date" fields, I have a simple script which is attached to a button that checks the "send on date", and the current system date, then sends out the appropriate documents.
There are 25 different documents any number of which may or may not be sent out depending on the client needs. The documents that are to be sent need to go out in a certain order of priority. That has not yet been done but could be set up with a priority field that has a number value.
For example client "A" will receive 20 of 25 different documents sent by email, there are approximately 100 days between today's date and the date of their travel. Therefore one email should be sent out every four days. Client "B" leaves in 29 days and will receive 11 of 25 different documents therefore one email should be sent approximately every three days.
Any ideas on how to best accomplish this??
I am not a guru - or coder so clarity and explanation is much appreciated.
Using FMP13 Advanced -