fix email import last date today
This commit is contained in:
@@ -269,6 +269,7 @@ class EmailAccount extends Record
|
||||
}
|
||||
|
||||
$previousLastUID = $lastUID;
|
||||
$previousLastDate = $lastDate;
|
||||
|
||||
if (!empty($lastUID) && !$forceByDate) {
|
||||
$idList = $storage->getIdsFromUID($lastUID);
|
||||
@@ -375,6 +376,11 @@ class EmailAccount extends Record
|
||||
$k++;
|
||||
}
|
||||
|
||||
if ($forceByDate) {
|
||||
$nowDt = new \DateTime();
|
||||
$lastDate = $nowDt->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$fetchData->lastDate->$folder = $lastDate;
|
||||
$fetchData->lastUID->$folder = $lastUID;
|
||||
|
||||
|
||||
@@ -281,6 +281,7 @@ class InboundEmail extends \Espo\Services\Record
|
||||
}
|
||||
|
||||
$previousLastUID = $lastUID;
|
||||
$previousLastDate = $lastDate;
|
||||
|
||||
if (!empty($lastUID) && !$forceByDate) {
|
||||
$idList = $storage->getIdsFromUID($lastUID);
|
||||
@@ -405,6 +406,11 @@ class InboundEmail extends \Espo\Services\Record
|
||||
$k++;
|
||||
}
|
||||
|
||||
if ($forceByDate) {
|
||||
$nowDt = new \DateTime();
|
||||
$lastDate = $nowDt->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$fetchData->lastDate->$folder = $lastDate;
|
||||
$fetchData->lastUID->$folder = $lastUID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user