diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/MassEmail.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/MassEmail.json index 8d11662b4a..f98f965f6a 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/MassEmail.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/MassEmail.json @@ -45,5 +45,9 @@ "optOutEntirely": "Email addresses of recipients that unsubscribed will be marked as opted out and they will not receive any mass emails anymore.", "targetLists": "Targets that should receive messages.", "excludingTargetLists": "Targets that should not receive messages." + }, + "presetFilters": { + "actual": "Actual", + "complete": "Complete" } } diff --git a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/MassEmail.json b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/MassEmail.json index 6b5ec712ee..960f960894 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/clientDefs/MassEmail.json +++ b/application/Espo/Modules/Crm/Resources/metadata/clientDefs/MassEmail.json @@ -71,5 +71,14 @@ } ] } - } + }, + "filterList": [ + { + "name":"actual" + }, + { + "name":"complete", + "style": "success" + } + ] } \ No newline at end of file diff --git a/application/Espo/Modules/Crm/SelectManagers/MassEmail.php b/application/Espo/Modules/Crm/SelectManagers/MassEmail.php index dada8d2b2d..cb264468ba 100644 --- a/application/Espo/Modules/Crm/SelectManagers/MassEmail.php +++ b/application/Espo/Modules/Crm/SelectManagers/MassEmail.php @@ -31,6 +31,20 @@ namespace Espo\Modules\Crm\SelectManagers; class MassEmail extends \Espo\Core\SelectManagers\Base { + protected function filterActual(&$result) + { + $result['whereClause'][] = array( + 'status' => ['Pending', 'Draft'] + ); + } + + protected function filterComplete(&$result) + { + $result['whereClause'][] = array( + 'status' => 'Complete' + ); + } + protected function acessOnlyOwn(&$result) { $result['whereClause'][] = array(