Hello
i need to fix a script for allow to send an email with the products in column H filled "order by column G ASC"
The script will work on this file https://docs.google.com/spreadsheets/d/1FKPmSekJmU0pQiYNuRcIu-2Zi1jgULlmwpqR7OKfxY4/edit#gid=0
the script is almost done and is this:
function ExpireDateMailAlert() {
var ss = [login to view URL]();
var sheet = [login to view URL]("Scadenze");
var range = [login to view URL]("G2:G");
var UserData = [login to view URL]();
for (i in UserData) {
var row = UserData[i];
//var name = row[0];
//var email = row[1];
var expiredate = row[7];
[login to view URL]("wefuhdo@[login to view URL]", "Scadenze", "Ciao Mfd, oggi ci sono questi articoli in scadenza " + expiredate);
//[login to view URL](row[1], "Custom mail", "Hello " + name + ", This is an email report of your score. Your score is " + score);
}
}
BUT the problem is that it send an email for each row, not olny one with the row required
Dear Sir or Ms.
I am John, pleased to meet you.
I'm well experienced in Google Apps Script and G Suite.
Please, take a look at my portfolio in my profile.
For which value, it should should send an email ?
Also , I hope you know, from a regularly/ free account you can send only 100 emails/ day.
Thank you for your time !
John
Hi!
I will be happy to help you with that one. You mentioned "BUT the problem is that it send an email for each row, not olny one with the row required", but never mentioned the required rows. I assume, based on the function name, that you want to send email alerts for certain rows in which the expiry date is close. I will be happy to help you with that issue or any other issue.
I will be happy to address any of your questions!
Sincerely,
Mohamed
I have gone through your script and requirement, from that what i understand is that you want email only when column H is not blank with this message:
"Hi Micaela, today there are these articles expiring + (values of column G/ or value of column D[expiry date].
if iam correct then your script is ready with me.....for further clarification message me