How To Send Email That Is Populated By Two or More Queries

I have three tables that I need to query and then send an email from the data retrieved. Am I to use the core repeater inside the mail action steps for each query?

I cannot get the data to populate the email page. Any suggestions would be appreciated.

Hello JR,
You can do a repeater after each of the queries, then inside the repeaters add Set Value steps, for each binding you need.
Then use these set value steps in your mail body, as they contain the info you need.


Thanks Teo!

Teo is this how the Action List should look after adding the Set Value steps? Do I need to select any outputs? When I get ready to insert the dynamic fields into the email page, there are not listings under each query. Is this normal? Or do I just manually type them in their place in the email page?

Thanks for your expert analysis.

When I add the server connect for the set values, and then install them in the mail, there’s still no data shown. I really must have missed something along the way.

Are you sure your setvalue steps have the output option enabled?
Also have you added them in the mail body, like {{binding_here}}?

Yes each of them is checked.

I also set up the ‘Server Connect’ and tried a couple and there’s nothing showing up.

The expression looks like this: {{[0].field_name}}

Does that look like it should?

What do you mean? Where do you see/use this expression?
All you need to do is to use the setvalue steps in the mail body, in the send mail step of your server action…
And they needed to be used like {{set_value_step_name}}

The screenshot I see is from the page/app connect - how is that related to your server action and mail body?

So, I am to only insert the {{home_phone}} part from the:
‘Set Value home_phone = {{home_phone}}’
in the body of the email_html page?

The {{home_phone}} becomes the variable?

Well yes, just use the setvalue step names as expressions, wrapped in {{ }}

Would there be any conflicts if there are some set value names being the same although they are in different tables?

Setvalue steps are variables. Your variable names must be unique, so not a great idea to name two setvalue steps the same.

Ah hah! So I need to rename those that are the same.

Now once I get the names unique, and then all I have to do is put SV steps in their respective location in the email manually – For example, Home Phone: {{home_phone}} … Correct?

Please forgive my ignorance.

Yes, exactly.


So what’s the difference between the ‘Name’ and the ‘Global Name’?

These two videos may help you a bit. They are for the Dreamweaver extension but are the same in Wappler.

Thanks, Brad. Yes, I’ve looked at them over and have used the information in the videos to build many more simple emails. However, what threw me on this round is the email is gathering data from three different tables. When I finished the queries with their respective core repeats and then tried to insert the usual {{data-binding}} from the steps, they weren’t there. I was lost… until Teo helped me along.

1 Like

These Set Values …

Would be placed in the email like this. Correct?

JR, you do this all SERVER SIDE.
I.e. in the send mail step in you server action - not on the page. (I can’t really see where’s your screenshot from, as it’s cut off)