Date Scheduled Task

Status
Not open for further replies.

degarrin

Member
Hello, I am having a bit of trouble getting a scheduled task to work, and I am hoping someone can offer some advice. I will admit that I am teaching myself, so any pointers are appreciated :)

Here is what I am trying to do. I want to send out emails 30 days before a member's birthday each year, and I want it to only go to currently active members. My birthday element is member___birth_date and I have a status element with the inactive members set as members___current_position_raw == 5.

I set up a scheduled task, and here was my conditional PHP attempt:

$date1 = (date('d-m',strtotime($row->member___birth_date_raw))==date('d-m'));
$date2 = strtotime("-30 day");
return $date1 < $date2;

But this sent an email to all members, not just those with birthdays upcoming in the next thirty days (which I may not have any, actually). And I know that the code above doesn't include the inactive members - that's because I didn't get that far and couldn't figure out where to put it.

Thank you
Angela
 
The easier way to do that is probably make a copy of your list, add pre-filters that do what you need, then use that for the cron job. No need to write any PHP.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top