I have an array of objects and in that i have emails and user information and i wanted to send emails using AWS SES.and to sending the email i have to add await or normal .then to send the message but i wanted to use await is it possible to use await inside forEach
here userRecord is [{},{},{}]
const userRecord = await Promise.all(recipient.map(getAuth));
userRecord.forEach(data => {
if (data.email !== '' && data.email !== undefined) {
console.log('created');
try {
const sendEmail = await SES.sendRawEmail(params).promise();
console.log('email submitted to SES', sendEmail);
} catch (error) {
console.log('error');
console.error(error);
}
}
});