Send mail to multiple recipient of server connect

Hi
I have a insert server connect that create a room booking and with a tagify input, the users join the booking.
I need to send an email to each user.

What I’ve done:


But I receive 4 emails instead of 3 (users join the booking) and with same informations (the first user of 3) instead of different for each.
Can someone help me?

Thanks

First of all the Setup Mailer and Security Provider steps should be defined under Globals in server connect. They should not be in the server action step:

Then to be able to answer your question please post a screenshot of the Send Mail step setup - what bindings are selected there exactly.

Are you intending to use a while loop for a specific purpose? Using a repeat step instead, pointed to the queryUsersReservation data would probably be more effective and give you access to each record’s values more easily.

If you want to use while it should just be < (not <=) - that is why you get 4 emails instead of 3

1 Like

Yes, i totally agree.

Well you are currently pointing to the first record of the query only:
Screenshot 2023-01-30 at 16.42.52

You need to add a repeat, which repeats the query (not this while thing there) and put the send mail step inside it. It will be repeated as many times as the number of database records are returned.

1 Like

Hi thanks to all.
This is what I’ve done before but this create an infinite loop that I needed to call my host provider to restart the server.

So I try the solution I’ve upload earlier.

The steps look correct. If you filter your database query properly and it returns 3 results i see no reason for and infinite loop.

I dont know why too. I will try again.
Thanks

You can just disable the mail step if you are not sure and use a setvalue step in the repeat, to see how many times the values will be outputted.

1 Like

I remember the ‘I Love You’ macro, flashbacks of that. Wappler user stops internet!

:smiley:

Only joking @pernetpervenches. Hope you get to where you need to be with your endeavour.

1 Like

So this is probably my last message…:slight_smile: :smile:

1 Like