phpScheduleIt
May 25, 2013, 01:11:58 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Email reminders show the wrong time  (Read 5583 times)
fmanniv
Newbie
*

Karma: 0
Posts: 1


« on: July 31, 2008, 07:49:51 PM »

I am enjoying this program and recently upgraded to 1.2.10. When testing all functions for a new schedule I noticed the email reminders were being sent at the right times but the text of the subject and body had the wrong times. Interestingly, they were off by exactly the server time offset. The config.php was set to the appropriate GMT and searching through this forum gave me ideas for fixes that all resulted in dead ends. I check the mysql databases and the reservations were being made correctly. As I said above, it was odd as the emails were being sent at the appropriate times but just displayed the wrong time in the subject and body of the email. Another piece to the puzzle is the dates were all correct. I know enough php to get myself in trouble, and in reviewing the ReminderEmail.class.php I noticed it was as follows beginning on line 80 for the body:

Time::formatDate($reminder->start_date, '', true, $reminder->timezone),
Time::formatTime($reminder->start_time, true, $reminder->timezone),
Time::formatDate($reminder->end_date, '', true, $reminder->timezone),
Time::formatTime($reminder->end_time, true, $reminder->timezone)

My limited php abilities did not help, but my "keen" observational skills allowed me to notice the '' missing in the start time and end time lines. These same '' were also missing on line 72 for the subject. Changing the above lines to include the '' as is seen on the date lines fixed all problems.

I'm not sure if anyone else has had this problem but searching the forums did not help. I saw one post wedged in between non-related posts that remarked the reminder times were also off by the GMT setting, but no answer had been posted to the March 2008 question (I apologize but searching again I could not find this original post to link). It seems this may be a solution for that problem.

Someone who knows more about php may wish to explain exactly what I did, but for now I will revel in my ignorance as I receive correct times in my reminder emails.
Logged
billguy
Newbie
*

Karma: 0
Posts: 5


« Reply #1 on: August 05, 2008, 12:51:42 PM »

Thank you fmanniv.  You just saved my time.  I was having the same issue but didn't have the time to dig deeper, now I don't have to.  Smiley
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #2 on: August 11, 2008, 09:51:43 AM »

Thank you!  I'll get this fixed for the next release.
Logged
rcbaker2
Newbie
*

Karma: 1
Posts: 2


« Reply #3 on: January 05, 2009, 08:18:47 PM »

This solution helped me too.  My only issue now is my server is GMT-7 and my users are all GMT-5.  The reminder is created at the right time, but the time in the reminder email is GMT-7.  I could change config.php to GMT-5, but this will then show reservation creation times two hours off.

Is there a code change to get the email message time to show in the user's timezone, rather than the server's timezone?

Thanks.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #4 on: January 06, 2009, 01:45:11 PM »

Yup, I have this fixed and will be available in the next maintenance release.
Logged
webmaster@eage.org
Newbie
*

Karma: 0
Posts: 1


« Reply #5 on: January 26, 2009, 03:08:13 AM »

Hi,

the fix is incorrect.
It does probably fix the problem, but only because it 'abuses' the Time library:

function formatTime($time, $adjust = true, $offset = null)

As you see, this function accepts 3 parameters max. As the fix introduces '' into the 2nd parameter, we do 'fix' it, but not without the server probably throwing warnings or so.

The real fix as I see it is in adding the time format call from the email reminders to the other code that works with times.
Looking through the code there seems to be an inconsistency; the email reminders do call the time format functionality to try and set the timezone right, but other code that shows times doesn't.
A quick fix that I applied to my server is the other way around, as we don't work with different timezones I just ripped out the time formatting from the email reminder code.


Logged
GeorgeT
Newbie
*

Karma: 0
Posts: 14


« Reply #6 on: March 09, 2009, 08:29:12 PM »

Tried both but I am still getting the times wrong. Any suggestions?
Logged
CBC-tech
Newbie
*

Karma: 0
Posts: 2


« Reply #7 on: May 22, 2009, 12:07:30 PM »

Curious as to whether this has a true solution yet. I too am experiencing strange times in my reminders...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!