Page 1 of 1

send birthday greeting

Posted: Wed Feb 02, 2022 2:28 am
by alisoroush7
hi guys
i have an idea in my mind. i have the birth date of our employees. is it possible to send an automatic email for greeting using process maker?

any comment is appreciated.

Re: send birthday greeting

Posted: Thu Feb 10, 2022 10:05 am
by ronrich
Hello alisoroush7,

Yes, it is, but not as it comes out of the box, there are timer events that could help but those are not available in the community version.

In this case, you could use a cronscript to read the user's properties, and based on the birth date it will send the greetings email. Since it is a corn job, you set it to run on a dayli basis.

I hope this helps.

Re: send birthday greeting

Posted: Sun Feb 13, 2022 1:52 am
by alisoroush7
ronrich wrote: Thu Feb 10, 2022 10:05 am Hello alisoroush7,

Yes, it is, but not as it comes out of the box, there are timer events that could help but those are not available in the community version.

In this case, you could use a cronscript to read the user's properties, and based on the birth date it will send the greetings email. Since it is a corn job, you set it to run on a dayli basis.

I hope this helps.
thanks for your recommend. but can you please tell me about the code?

Re: send birthday greeting

Posted: Mon Feb 14, 2022 4:01 pm
by ronrich
Hello alisoroush7,

You need to query the USERS table and then loop the result looking for the matching dates to send the email.
Code: Select all
$sql = 'Select USR_FIRSTNAME, USR_LASTNAME, USR_BIRHTDAY, USR_ from USERS_EMAIL';
$result = executeQuery($sql);
foreach ($result as $user){
   if (date("Y-m-d") == date("Y-m-d", strtotime($user['USR_BIRTHDAY'])){
     $email = $user['USR_EMAIL'];
     $fullname = $user['USR_FIRSTNAME']." ".$user['USR_LASTNAME'];
     PMFSendMessage(.....);
}
}

I hope this helps, you still need to add the rest of the logic.

Kind regards,

Re: send birthday greeting

Posted: Sat May 14, 2022 12:22 am
by alisoroush7
ronrich wrote: Mon Feb 14, 2022 4:01 pm Hello alisoroush7,

You need to query the USERS table and then loop the result looking for the matching dates to send the email.
Code: Select all
$sql = 'Select USR_FIRSTNAME, USR_LASTNAME, USR_BIRHTDAY, USR_ from USERS_EMAIL';
$result = executeQuery($sql);
foreach ($result as $user){
   if (date("Y-m-d") == date("Y-m-d", strtotime($user['USR_BIRTHDAY'])){
     $email = $user['USR_EMAIL'];
     $fullname = $user['USR_FIRSTNAME']." ".$user['USR_LASTNAME'];
     PMFSendMessage(.....);
}
}

I hope this helps, you still need to add the rest of the logic.

Kind regards,
should i change anything in your code? or i should just configure the pmfsendmessgae() ?