Hello, I have a code that lets me register multiple members at once from a page within the control panel (discussed over here: https://www.wix.com/corvid/forum/community-discussion/registering-multiple-members-at-once ). But I would also like to send personalized emails to the newly registered members with their password (as I register them, I have their access password). I have been trying to achieve this with no avail.
Here’s the basic code for registering multiple members with a button click (the emails and passwords are stored in a database called “UsersCSV”):
import wixUsers from 'wix-users';
import wixData from 'wix-data';
export function button1_click(event) {
wixData.query("UsuariosCSV")
.limit(1000)
.find()
.then((result) => {
let items = result.items;
for (var i = 0; i < items.length; i++){
if (items[i] === null) continue;
wixUsers.register(items[i].email, items[i].pass);
}
console.log(result.items);
console.log('done');
});
}
I have tried with Triggered Emails but I’ve read they don’t have this functionality. I also tried this solution (https://www.wix.com/corvid/forum/community-discussion/contactid) to obtain the ID of the contacts through their email, so I could send a Triggered Email using a the password as variable (Velo Tutorial: Sending a Triggered Email to Contacts | Help Center | Wix.com) but haven’t been able to implement it.
Any advice would be greatly appreciated.