i got a table with a date in postgresql. So if today is 30/11/2023 and i set expiration date = 30/12/2023 it should send a reminder that in 30 days that thing will expire, but its not working
If you really want to send one email per, change query3 into a loop, with the input from expira30d and the loop lambda as your correo resource. Then you'd replace expira30d.data['0'] in your email template with value so you'd end up with {{ value.marca }}.
You could also send one email, that lists each expiring vehicle. To do that, it's probably easiest to add a block in between that loops over each items in the expira30d array and builds out the email body string. Then you can just reference that string in the body of your email in query3.