We help IT Professionals succeed at work.

Filemaker multiple recipient emails

afbaer
afbaer asked
on
670 Views
Last Modified: 2012-06-27
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
Comment
Watch Question

Commented:
Hi afbaer

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

Commented:
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"

Author

Commented:
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

Commented:
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!

Author

Commented:
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?

Commented:
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.

Author

Commented:
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?

Commented:
I'm going to have to look at this later on today, I've got a busy day.  Back soon.

Author

Commented:
No worries. Whenever you can help is much appreciated.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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...

Author

Commented:
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....

Author

Commented:
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!!!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.