I am sure this is an easy question but I am stumped!
I have a table – usersTable – containing three fields: email, first_name and last_name. I want to be able to select more than one of the records in the table and send each a personalised email. On clicking the ‘Send Email’ button the following query runs.
The console.log shows the two selected emails correctly.
It then executes the query ‘send_email’.
Unfortunately, I cannot work out what to put in the To field so that an email is sent to each address individually. With the current entry two emails are sent to the same email address which is the first on the table. I am sure it must be to do with the variable ‘emails’ but how to get that into the To field is escaping me. Any help would be gratefully received.