Prompt to send email automatically as remainders to file Income Tax Return to clients
Problem
Sending automatic email as remainders to file Income Tax Return to clients for which ITR status is blank. It automatically changes the email status as "Yes" after sending email to clients. ChatGPT is used to generate code to run app script. This App Script generated by ChatGPT is pasted in Google App Script to send remainders.
Prompt Input
Google Sheet having columns such as Name of Client, PAN, Email ID, ITR Status, Email Status. Prompt is as under: Please generate the script with below column in sheet1 Name of Client PAN Email ID ITR Status Email Status The script should send email to the client for which ITR Status blank. The email should remind client to file their ITR. After sending email update the email status to Yes. App Script code generated is as under: function sendITRReminderEmails() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); var data = sheet.getDataRange().getValues(); for (var i = 1; i < data.length; i++) { // Start from row 2 var name = data[i][0]; // Column A - Name var pan = data[i][1]; // Column B - PAN var email = data[i][2]; // Column C - Email ID var itrStatus = data[i][3]; // Column D - ITR Status var emailStatus = data[i][4]; // Column E - Email Status // Send email only if ITR Status is blank and Email Status is not Yes if ((itrStatus === "" || itrStatus === null) && emailStatus !== "Yes") { var subject = "Reminder to File Your Income Tax Return"; var message = "Dear " + name + ",\n\n" + "This is a gentle reminder to file your Income Tax Return for the current Assessment Year.\n\n" + "PAN: " + pan + "\n\n" + "Please file your ITR at the earliest to avoid interest and penalties.\n\n" + "If already filed, please ignore this message.\n\n" + "Regards,\n" + "Your Tax Consultant"; MailApp.sendEmail(email, subject, message); // Update Email Status to Yes sheet.getRange(i + 1, 5).setValue("Yes"); } } SpreadsheetApp.getUi().alert("ITR Reminder Emails Sent Successfully!"); }
Prompt Output
Directly send emails to clients reminding them to file ITR.

