fix email queue
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
"status": {
|
||||
"Pending": "Pending",
|
||||
"Sent": "Sent",
|
||||
"Failed": "Failed"
|
||||
"Failed": "Failed",
|
||||
"Sending": "Sending"
|
||||
}
|
||||
},
|
||||
"presetFilters": {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": {
|
||||
"type": "enum",
|
||||
"options": ["Pending", "Sent", "Failed"],
|
||||
"options": ["Pending", "Sent", "Failed", "Sending"],
|
||||
"readOnly": true
|
||||
},
|
||||
"attemptCount": {
|
||||
|
||||
@@ -399,6 +399,9 @@ class MassEmail extends \Espo\Services\Record
|
||||
return;
|
||||
}
|
||||
|
||||
$queueItem->set('status', 'Sending');
|
||||
$this->getEntityManager()->saveEntity($queueItem);
|
||||
|
||||
$target = $this->getEntityManager()->getEntity($queueItem->get('targetType'), $queueItem->get('targetId'));
|
||||
if (!$target || !$target->id || !$target->get('emailAddress')) {
|
||||
$queueItem->set('status', 'Failed');
|
||||
|
||||
Reference in New Issue
Block a user