afbaer
asked on
Filemaker multiple recipient emails
We need to send email job confirmations to staff who work in a group on the same job. These emails should include the name and phone numbers of the other staff on the same job.
With the help of lesouef I formalated a script to send an email to a single staff member in the group containing details of all the staff, including their own name. These scripts appear at the top of the script table of the dtatabe attached.
Tocarcar helped me go one step further with a script that sends an email to all staff in the group by loop, omitting the details of the person the email is directed to. This is the first script in the table. I commissioned this solution but have run into a problem when the same staff member is employed on several Group Jobs. In this case the email confirms the wrong job details. I guess this is \because the email loop refers to the Staff table rather than the Jobs table, so it can't reference the Group Job Number.
I am happy to put this up for more points since Tocarcar spent so much time on it before. Mayhbe he can come up with the final solution, but all help appreciated.
With this problem solved I will then post another question requesting a solution that sends a single email confirmation to a Staff member in a Group job, omitting their own details.
Thanks to all! SassyEE.fp7
With the help of lesouef I formalated a script to send an email to a single staff member in the group containing details of all the staff, including their own name. These scripts appear at the top of the script table of the dtatabe attached.
Tocarcar helped me go one step further with a script that sends an email to all staff in the group by loop, omitting the details of the person the email is directed to. This is the first script in the table. I commissioned this solution but have run into a problem when the same staff member is employed on several Group Jobs. In this case the email confirms the wrong job details. I guess this is \because the email loop refers to the Staff table rather than the Jobs table, so it can't reference the Group Job Number.
I am happy to put this up for more points since Tocarcar spent so much time on it before. Mayhbe he can come up with the final solution, but all help appreciated.
With this problem solved I will then post another question requesting a solution that sends a single email confirmation to a Staff member in a Group job, omitting their own details.
Thanks to all! SassyEE.fp7
I should have said..... if so, this can be achieved by simply creating an outer loop which loops through your Shift records, performing the send e:Mail section of the script (inner loop) for each one. Maybe you could have a hidden field in the shift table which records whether or not the e:Mail script has been run, then in your outer loop you could use an If statement to say "If the e:Mail hasn't already been sent for this shift, send it, otherwise, skip to the next shift record"
ASKER
Thanks Tocarcar but I didn't explain myself properly. We dont want to send multiple group shift email confirmations. The problem is that the existing solution sends emails confirming the incorrect venue and shift details if the same Staff are on multiple group shifts. For instance in the attached database, the script works fine when confirming the first Group Shift at venue Bligh Park, but if you try to email Adam Murray or Adrian Giovenio confirmation of their jobs at Venues "Home" or "Parramatta" they still get the venue details for Bligh Park, as per the header line in the email. This is because the loop email script references the Staff record rather than the Shift record, so it doesn't distinguish between several Shifts assigned to the same Satff member. Hope this makes sense?
SassyEE.fp7
SassyEE.fp7
OK, so all you need to do is capture the job details in a variable at the start of the script and use the variable in the e:Mail script to display the correct job. Problem solved!
ASKER
Thanks and see what you mean, but don't we still have a problem when rates of pay or other details vary for the same job?
Possibly - I don't know the full extent of the information you're hoping to capture in your e:Mail. If you set out a draft of the e:Mail you hope to send, highlighting the text taken from other records (and stating which table each bit of info comes from), I'll see what I can do for you.
As I said in a previous post (on the other question), I think your database's structure is severely comprising the flexibility of the system and you're probably going to be limited in some of the things you hope to achieve.
As I said in a previous post (on the other question), I think your database's structure is severely comprising the flexibility of the system and you're probably going to be limited in some of the things you hope to achieve.
ASKER
If you look at the Staff Email script right at the top, that shows all the fileds we need to reference in the email. Hear what you say about the database structure - the frustrating thing if that it does everything we need it to do except this final function.
I don't know if it's worth going down the route of the script I have for the single email confirmation including all names and just loop it? All Shift fields are included correctely in the email confirmation using this script, but it still leaves the problem of excluding the name and phone number of the person the email is being sent to. Maybe you can see a way around that?
I don't know if it's worth going down the route of the script I have for the single email confirmation including all names and just loop it? All Shift fields are included correctely in the email confirmation using this script, but it still leaves the problem of excluding the name and phone number of the person the email is being sent to. Maybe you can see a way around that?
I'm going to have to look at this later on today, I've got a busy day. Back soon.
ASKER
No worries. Whenever you can help is much appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much Tocarcar! I see where you are coming from and it looks good.I'll test it on the actual database at work tomorrow or Tues and get back to you. Fingers x'd all round...
ASKER
Finally got round to testing it thoroughly and it works just fine. Many thanks!
I will now post the next question and reckon you have the lead on that and can hopefully solve it easily....
I will now post the next question and reckon you have the lead on that and can hopefully solve it easily....
ASKER
Tocarcar - the next question was going to be how to send a single email to a group Shift participant in case one of them needed to be substituted, I now think you have given me enough info to work this out for myself. I will play with it and get back to you case need.
Otherwise thanks again!!!
Otherwise thanks again!!!
The solution I provided previously was designed to act on a single Shift record (e:Mailing the staff assigned to that specific shift). Do you now want the script to act on multiple shift records?
Tocacar