I have a list that populates all clients that we need to email to request data for specific members. Each client has multiple members. I need to create 1 email per client that includes rows for all members. Right now, the client will get 1 email per member instead of 1 email that includes all members.
Here is what i right now that produces an email per row (member).
function send_email() {
const id = '1wVt2695ccH9kcUEfMSBYqvhskMCMZrOjANTgt-3kwvE';
const sheet = SpreadsheetApp.openById(id).getSheetByName ('test send email');
const data = sheet.getDataRange().getValues();
const users = data.slice (3);
users.forEach(user =>{
const email = user[5];
const CPID = user [1];
const MEMBERNAME = user[0];
const DATEOFBIRTH = user[2];
var FORMATTEDDATEOFBIRTH = Utilities.formatDate(DATEOFBIRTH, "EST", "dd/MM/yyyy")
const ADMITDATE = user[3]
var FORMATTEDADMITDATE = Utilities.formatDate(ADMITDATE, "EST", "dd/MM/yyyy")
Utilities.formatDate(user[3], "EST", "MM/dd/yyyy");
const message = 'TEST'
const subject = 'TEST- SECURE - Request for Discharge Summary from Clover Health-TEST';
GmailApp.sendEmail(email,subject,message);
})
}
user25044432 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.