Commit a5878fe9 authored by Dante Piombino's avatar Dante Piombino

update timestamp in block; update saving of timestamps for events; fix notice...

update timestamp in block; update saving of timestamps for events; fix notice when no html version is available; update version above what is available on magento connect; add migration to fix timestamp storage
parent 30ba9309
......@@ -4,7 +4,7 @@ class FreeLunchLabs_MailGun_Block_Adminhtml_Event_Renderer_Timestamp extends Mag
public function render(Varien_Object $row)
{
$value = $row->getData($this->getColumn()->getIndex());
$date = Mage::getSingleton('core/date')->date(null, $value);
$date = Mage::getSingleton('core/date')->timestamp($value);
return Mage::helper('core')->formatDate(new Zend_Date($date), 'medium', true);
}
}
\ No newline at end of file
......@@ -75,7 +75,7 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
if($store->getConfig('mailgun/events/store')) {
$this->processEmailEventsForSingleStore($store);
}
}
}
}
public function processEmailEventsForSingleStore(Mage_Core_Model_Store $store) {
......@@ -88,9 +88,9 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
);
$mailgunEvents = $this->mailgunRequest(
'events',
$store->getConfig('mailgun/general/domain'),
$store->getConfig('mailgun/general/key'),
'events',
$store->getConfig('mailgun/general/domain'),
$store->getConfig('mailgun/general/key'),
$data
);
......@@ -98,12 +98,12 @@ class FreeLunchLabs_MailGun_Model_Mailgun extends Mage_Core_Model_Abstract {
while (sizeof($mailgunEvents->items) > 0) {
$mailgunEvents = $this->mailgunRequest(
'events',
$store->getConfig('mailgun/general/domain'),
$store->getConfig('mailgun/general/key'),
'events',
$store->getConfig('mailgun/general/domain'),
$store->getConfig('mailgun/general/key'),
$data,
Zend_Http_Client::GET,
$mailgunEvents->paging->next
$mailgunEvents->paging->next
);
$events = array_merge($events, $mailgunEvents->items);
......
......@@ -148,7 +148,7 @@ class FreeLunchLabs_MailGun_Model_Messagebuilder extends Varien_Object {
}
public function getHtmlBody() {
return $this->message['html'];
return isset($this->message['html']) ? $this->message['html'] : " ";
}
public function addAttachment($filename, $data) {
......
......@@ -2,7 +2,7 @@
<config>
<modules>
<FreeLunchLabs_MailGun>
<version>1.0.1</version>
<version>1.0.2</version>
</FreeLunchLabs_MailGun>
</modules>
<global>
......@@ -74,11 +74,11 @@
<menu>
<customer>
<children>
<cloudfront translate="title" module="mailgun">
<emailtracking translate="title" module="mailgun">
<title>Email Tracking</title>
<sort_order>9999</sort_order>
<action>adminhtml/emailtracking</action>
</cloudfront>
</emailtracking>
</children>
</customer>
</menu>
......@@ -86,6 +86,14 @@
<resources>
<admin>
<children>
<customer>
<children>
<emailtracking translate="title" module="mailgun">
<title>Email Tracking</title>
<sort_order>70</sort_order>
</emailtracking>
</children>
</customer>
<system>
<children>
<config>
......@@ -148,4 +156,4 @@
</freelunchlabs_processevents>
</jobs>
</crontab>
</config>
\ No newline at end of file
</config>
<?php
$installer = $this;
$installer->startSetup();
// do nothing!
$installer->endSetup();
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
ALTER TABLE {$this->getTable('freelunchlabs_mailgun/event')}
CHANGE `timestamp` `timestamp_old` varchar(255);
ALTER TABLE {$this->getTable('freelunchlabs_mailgun/event')}
ADD COLUMN `timestamp` timestamp;
UPDATE {$this->getTable('freelunchlabs_mailgun/event')}
SET `timestamp`=from_unixtime(`timestamp_old`+(((timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00'))*-1)/10000)*60*60));
ALTER TABLE {$this->getTable('freelunchlabs_mailgun/event')}
DROP COLUMN `timestamp_old`;
");
$installer->endSetup();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment