Send Automatic Birthday Wishes | Google Sheets Tutorial

Поделиться
HTML-код
  • Опубликовано: 21 дек 2024

Комментарии •

  • @AjayAnandXLnCAD
    @AjayAnandXLnCAD  5 месяцев назад +3

    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);
    }
    }
    }

  • @technsem3362
    @technsem3362 2 месяца назад

    please what if I want to send the messages to a number and the message also in the sheet

  • @sallyho146
    @sallyho146 5 месяцев назад

    How do we do that in outlook

  • @mmgaffoor
    @mmgaffoor 5 месяцев назад

    Great, Thanks

  • @BlackMarkerSir
    @BlackMarkerSir 5 месяцев назад

    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?"

  • @mkrissna
    @mkrissna 4 месяца назад

    Thanks Bro, is that possible to send birthday wishes similarly through WhatsApp