diff --git a/EventListener/TokenSubscriber.php b/EventListener/TokenSubscriber.php index 371e1325b..0d597b611 100644 --- a/EventListener/TokenSubscriber.php +++ b/EventListener/TokenSubscriber.php @@ -429,8 +429,11 @@ private function getCustomFieldDataForLead(array $filters, string $leadId): arra * * @return array */ - private function getCustomFieldValue(CustomObject $customObject, string $customFieldAlias, array $customItems): array - { + private function getCustomFieldValue( + CustomObject $customObject, + string $customFieldAlias, + array $customItems + ): array { $fieldValues = []; foreach ($customItems as $customItemData) { @@ -482,7 +485,8 @@ private function getCustomItems(CustomObject $customObject, string $leadId): arr return $this->customItemModel->getArrayTableData($tableConfig); } - // We have a similar function in MatchFilterForLeadTrait since we are unable to alter anything in Mautic 4.4, hence there is some duplication of code. + // We have a similar function in MatchFilterForLeadTrait since we are unable to alter anything in Mautic 4.4, + // hence there is some duplication of code. /** * @param array $filter diff --git a/Tests/Functional/Token/EmailWithCustomObjectDynamicContentFunctionalTest.php b/Tests/Functional/Token/EmailWithCustomObjectDynamicContentFunctionalTest.php index bc90c213a..771061fa1 100644 --- a/Tests/Functional/Token/EmailWithCustomObjectDynamicContentFunctionalTest.php +++ b/Tests/Functional/Token/EmailWithCustomObjectDynamicContentFunctionalTest.php @@ -72,6 +72,9 @@ protected function setUp(): void $this->customFieldValues['nexon-multiselect'] = $this->customItems['nexon']->findCustomFieldValueForFieldAlias('multiselect-test-field'); $this->customFieldValues['nexon-multiselect']->setValue('option_a'); + $this->customFieldValues['nexon-number'] = $this->customItems['nexon']->findCustomFieldValueForFieldAlias('number-test-field'); + $this->customFieldValues['nexon-number']->setValue(10); + $this->customItems['nexon'] = $this->customItemModel->save($this->customItems['nexon']); $this->customItems['fortuner'] = new CustomItem($this->customObject); @@ -102,14 +105,15 @@ public function testDynamicContentEmail(): void 'nexonmultiselect@acquia.com', $this->buildDynamicContentArray([ ['nexon-datetime', null, '!empty', 'datetime'], + ['nexon-number', 12, 'lt', 'number'], ]), 'Custom Object Dynamic Content', ], [ 'nexonmultiselect@acquia.com', $this->buildDynamicContentArray([ ['nexon-text', 'Tata', '='], - ['nexon-datetime', '2024-07-01', 'gte'], - ['nexon-multiselect', 'option_a', 'in'], + ['nexon-datetime', '2024-07-01 00:00', 'gte', 'datetime'], + ['nexon-multiselect', 'option_a', 'in', 'multiselect'], ]), 'Custom Object Dynamic Content', ], [