vtiger Forum Index vtiger
The Honest Open Source CRM
 

How to Send Notification Email to User at a Specific Time?
Click here to go to the original topic

 
       vtiger Forum Index -> Help - 5.0.4
Previous topic :: Next topic  
Author Message
sywee



Joined: 25 Jun 2008
Posts: 27
Location: Malaysia

Posted: Tue Aug 26, 2008 2:52 am    Post subject: How to Send Notification Email to User at a Specific Time?  

Facing a problem currently on how to execute a php script everyday at a specific time in order to retrieve data from database daily to send notification emails to user.

This particular problem is encountered when wanna configure the notification email for the Trouble Tickets which are due 3 days before the due date. Hence, the script need to automatically search the database at a specific time everyday to check for all the trouble tickets which are going to due soon.

Can anyone advise on this?
Back to top  
pinaki



Joined: 18 Oct 2007
Posts: 57

Posted: Tue Aug 26, 2008 3:07 am    Post subject: Re: How to Send Notification Email to User at a Specific Tim  

Hi sywee,

You are trying to run the script at a particular time everyday day, which might be done as follows:

Put the code for sending nitifications in the header.php with a time check; i.e. in header.php -

Code: if(date(H:i:s) == "$REQUIRED_DATE"){
     send_notifications();
}

Please check the php manual for implementing the date function (my example gives a 24-hour time).

But what if the vtiger server is not running at that time. The script would not run in this case. I would suggest to use a flag variable (to specify if notification has been sent for a troubleticket or not) and a script to determine the difference between due date and current date. Whenever a trouble ticket crosses this limit (3 days in your case), you can send the mail. This script will also be placed in the header.php.

Please provide the feedback on how you achieved your purpose. Feel free to contact me for any further suggestions.

Thanks
Pinaki
vTiger Team
Back to top  
sywee



Joined: 25 Jun 2008
Posts: 27
Location: Malaysia

Posted: Tue Aug 26, 2008 4:00 am    Post subject: Re: How to Send Notification Email to User at a Specific Tim  

Thanks for the advice! I will definitely have a try on it.

Btw, what is the header.php file that you are referring to?
Back to top  
pinaki



Joined: 18 Oct 2007
Posts: 57

Posted: Tue Aug 26, 2008 4:16 am    Post subject: Re: How to Send Notification Email to User at a Specific Tim  

Hi sywee,

The header.php is present in all the "themes" folder (e.g. themes/softed/header.php). The purpose of this file is to create the headers for vtiger (the page title, etc.). Hence this file is called in all other files and you can guarantee that your script will run whichever page you be on.

Make sure to include the changes you make in all header.php files you have (i.e. in all themes folders) to get the changes in all themes.

Thanks
Pinaki
vTiger Team
Back to top  
sywee



Joined: 25 Jun 2008
Posts: 27
Location: Malaysia

Posted: Tue Aug 26, 2008 5:43 am    Post subject: Re: How to Send Notification Email to User at a Specific Tim  

Realized one thing, what if the user did not access the system, and so, the automatic notification email triggering would not be working then. And by the time the user access the system and the notification will not be accurate anymore.

Is there any other alternative/solution for this?
Back to top  
reetp



Joined: 28 Nov 2006
Posts: 79

Posted: Wed Aug 27, 2008 4:11 pm    Post subject: Re: How to Send Notification Email to User at a Specific Tim  

Think you need to have a look at the sendreminder script which calls a php file :

http://wiki.vtiger.com/index.php/Vtiger_CRM_5.0.4_-_Installation_Manual_for_Linux

Look for Configuring Notification Scheduler

B. Rgds
John
Back to top  
 
       vtiger Forum Index -> Help - 5.0.4
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group