Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time difference in SMTP Pro E-Mail-Log Grid and Detail view #265

Open
FelixKonVis opened this issue May 3, 2019 · 2 comments
Open

Time difference in SMTP Pro E-Mail-Log Grid and Detail view #265

FelixKonVis opened this issue May 3, 2019 · 2 comments

Comments

@FelixKonVis
Copy link

There seems to be a problem with the smtppro_email_log table entries and their log_at column.

From what I found in the code:

  1. The SMTP Pro E-Mail Log Grid uses the Magento Datetime renderer which takes into account the timezone.

  2. The SMTP Pro E-Mail Log Detail view displays the plain value of log_at.

  3. The smtpro_email_log table uses CURRENT_TIMESTAMP to update the log_at column
    This happens to be local time (GMT+2) for us.

In our case the shop is running in GMT+2 (GMT+1 + DST) and we are seeing the correct time in the E-Mail details but another +2h rendered in the Grid.

Am I missing anything? This seems to be a bug since the log entries store the local time in log_at but the Grid expects the datetime in GMT.

One possible fix might be to change the Grid column from type datetime to text so both Grid and Detail view display the same time.

Originally posted by @FelixKonVis in #263 (comment)

@MartinKonVis
Copy link

Hello aschroder-Team,

I would like to ask if there is allready a update regarding this issue? The extension is great and our client loves it. The mail log is great for quick check if there was a problem with the store or the client need to check spam filter etc.

But the time difference makes it hard for not IT-Persons to get the right timestamp. Would be great if you can double check the mentioned points. We can fix it but than we might get problems if you provide a update version etc.

Unfortunatly we got little bit under time pressure. We can fix it and provide you the code if it helps? Thanks in advance.

@dbachmann
Copy link

It's a bit late, I know :)

The time of the mail that has already been saved, is sent again in the grid view through the datetime renderer. So the specified time zone is applied again and this is why there are different times in the grid view and in the detail view.

I will make the bug fix available as a commit when I get the time, although it is actually really simple. Open app/code/local/Aschroder/SMTPPro/Block/Log/Grid.php and add 'use_timezone' => 0 to the array of column ID 'sent' at the end. That's all.

When you're done, it should look like this

$this->addColumn('sent', array(
'header' => Mage::helper('adminhtml')->__('Sent'),
'width' => '60px',
'index' => 'log_at',
'type' => 'datetime',
'use_timezone' => 0
));

Have fun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants