How to automate email for birthday

Hi All,
I want to automate email for birthday wishes. I have following data in excel.
What will be the steps in AE Proces Studio.

Name DOB Email
Mark Oct 15,1999 mark@gmail.com
Henry Nov 10,2001 henry@gmail.com
John Oct 11,2002 john@gmail.com
Arya Oct 15,1975 arya@gmail.com
Rose Jan 13,1985 rose@gmail.com

@habibur.rahamanin.d

  • You can first fetch the details using Excel Input Step
  • Set a variable with current date in Modified Java script Step and compare it with Date from previous step.
  • If the date/Month is equal to current date(not year) the you can fetch the email address, name and Send email using Send email step to Specific user.

Hi Gaurav,
Thanks for your input. However, I have tried with the same logic before in Modified Java Script Step, but it did not work. The required Email is not getting retrieved. Please note the excel that I used contains one DOB as today’s date (Oct 12).

Hello @habibur.rahamanin.d

The code works fine, you can check the demo workflow as below

date_operations.psw (21.8 KB)

Thank you for your input.
However, with your given solution it didn’t work either. Later on I found out the actual issue in the code itself. I altered the code logic and it worked finally.

Hello @habibur.rahamanin.d

What change you have done? can you share?

Sorry for the late reply.
Here is the code that I used:

var dobDateMonth = date2str(DOB, “dd-MM”);
var today = new Date();
var todayDateMonth = date2str(today, “dd-MM”);
var mail;

if (dobDateMonth == todayDateMonth)
{
mail = true;
}
else
{
mail = false;
}

1 Like