Apps Script Code for sending Birthday Wishes function sendBirthdayWishes() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var dataRange = sheet.getDataRange(); var data = dataRange.getValues(); var today = new Date(); var todayDayMonth = today.getDate() + "-" + (today.getMonth() + 1); for (var i = 1; i < data.length; i++) { if (data[i][0] === '') { continue; // Skip empty rows } var name = data[i][1]; // Adjust column index based on your sheet var dobCell = data[i][2]; // Date of Birth column var dob; if (typeof dobCell === 'object' && dobCell instanceof Date) { dob = dobCell.getDate() + "-" + (dobCell.getMonth() + 1); // Format DD-MM } else if (typeof dobCell === 'string' && dobCell !== '') { var dobParts = dobCell.split("/"); dob = dobParts[0] + "-" + dobParts[1]; // Format DD-MM } else { continue; // Skip rows with invalid or empty Date of Birth } if (dob === todayDayMonth) { var email = data[i][3]; // Email column var subject = "Happy Birthday " + name + "!"; var message = "Dear " + name + ",
Wishing you a very Happy Birthday! Have a fantastic day!
Best Regards, Ajay Anand"; MailApp.sendEmail(email, subject, message); } } }
Hi sir I am maths teacher I had created the marksheet of students only maths subject where I had taken multiple test but everytime whenever I want to make that I have to search the students name first then in next column I write there marks So my question is'' is there an any formula where I write there name and there marks so it's automatically add in column?"
Apps Script Code for sending Birthday Wishes
function sendBirthdayWishes() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var dataRange = sheet.getDataRange();
var data = dataRange.getValues();
var today = new Date();
var todayDayMonth = today.getDate() + "-" + (today.getMonth() + 1);
for (var i = 1; i < data.length; i++) {
if (data[i][0] === '') {
continue; // Skip empty rows
}
var name = data[i][1]; // Adjust column index based on your sheet
var dobCell = data[i][2]; // Date of Birth column
var dob;
if (typeof dobCell === 'object' && dobCell instanceof Date) {
dob = dobCell.getDate() + "-" + (dobCell.getMonth() + 1); // Format DD-MM
} else if (typeof dobCell === 'string' && dobCell !== '') {
var dobParts = dobCell.split("/");
dob = dobParts[0] + "-" + dobParts[1]; // Format DD-MM
} else {
continue; // Skip rows with invalid or empty Date of Birth
}
if (dob === todayDayMonth) {
var email = data[i][3]; // Email column
var subject = "Happy Birthday " + name + "!";
var message = "Dear " + name + ",
Wishing you a very Happy Birthday! Have a fantastic day!
Best Regards,
Ajay Anand";
MailApp.sendEmail(email, subject, message);
}
}
}
please what if I want to send the messages to a number and the message also in the sheet
How do we do that in outlook
Great, Thanks
Hi sir I am maths teacher I had created the marksheet of students only maths subject where I had taken multiple test but everytime whenever I want to make that I have to search the students name first then in next column I write there marks
So my question is'' is there an any formula where I write there name and there marks so it's automatically add in column?"
USE V LOOKUP FORMULA
Thanks Bro, is that possible to send birthday wishes similarly through WhatsApp