Forums › Forums › OroCRM › OroCRM – Installation/Technical Issues or Problems › No Lead by E-Mail Creation in orocrm 2.0
This topic contains 4 replies, has 2 voices, and was last updated by Martin 7 years, 1 month ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- March 15, 2017 at 7:59 am #27625
Hello,
we’re evaluating orocrm.The app was installed as described in the github repo, including supervisord and cron setup and is working correctly. We set it up in production env.
Also we created a sales channel, and added business customer and sales process as entities. Both Opportunity and Lead Types are activated from Config/CRM/Sales.
Both Lead and Opportunities can be created manually. Also the Unqualified Sales Lead Workflow is activated and working.
We then added a System mailbox via Config/Email/System Mailboxes (Imap and SMTP enabled) with E-Mail processing Action set to ‘Convert to lead’, Owner and source ‘demand generation’. Also Access Management is configured. The E-Mail Accounts (local Mail Server / Linux based) Folders show up correctly.
Also we added a Auto-Responder with a template.
Now the Problem:
For testing purposes, we then send an Email from an external Mail Provider to our newly configured Mailbox. The Mail was written as plain text and did not contain any special characters.
A Minute later, the E-Mail shows up correctly in the System Mailbox inside orocrm. Also the job Processing shows the auto respond message is successfully send and it actually is (Confirmed in Senders inbox).
No Errors are logged.
So the whole Email parsing process works, but no Lead Entity is created. We’ve read through a lot of Forum posts ans already checked the database charset etc.
It looks like the Inbox to lead process is never executed.
In User Guide / Customer Mngt it seems like you can add Opportunity and Lead to the sales channel.
These Entities are not available in the current release.
Could this be the source of the problem?
Thank you in advance & Kind Regards
Martin - CreatorTopic
- AuthorReplies
- March 17, 2017 at 9:46 am #27626
Hi Martin
Unfortunately, you have found a bug. Thank you for reporting it! As workaround, I suggest that you remove this line and run:
Shell1app/console oro:process:configuration:loadPlease note, that a lead is created after you click on the email message, for example on the user’s My Emails page.
March 18, 2017 at 6:41 am #27627Hi Mike,
many thanks for your support! I can confirm, that it’s working now.
Does this workaround has any impact on the crms internal processing logic?
March 23, 2017 at 3:32 am #27628Does this workaround has any impact on the crms internal processing logic?
The issue will be fixed in the next release, but for now you can apply the following patch. Please, put the file into the root directory of your project and run the following command:
Shell1git apply --directory=vendor/oro patch.txtpatch.txt:
INI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312From 763efd546e480ba5851096ba7a0acfff71bbe452 Mon Sep 17 00:00:00 2001From: Makar Sichevoy <sichevoy@gmail.com>Date: Tue, 21 Mar 2017 17:03:18 +0200Subject: [PATCH 1/2] BAP-14289: System Email Mailbox doesn't convert to Lead---.../SalesBundle/Resources/config/oro/processes.yml | 8 +-.../ActionBundle/Resources/config/conditions.yml | 5 ++.../EmailBundle/Resources/config/services.yml | 2 +-.../ConfigExpression/Condition/HasProperty.php | 94 ++++++++++++++++++++++4 files changed, 107 insertions(+), 2 deletions(-)create mode 100644 platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.phpdiff --git a/crm/src/Oro/Bundle/SalesBundle/Resources/config/oro/processes.yml b/crm/src/Oro/Bundle/SalesBundle/Resources/config/oro/processes.ymlindex 07d5ad4..8b40a58 100644--- a/crm/src/Oro/Bundle/SalesBundle/Resources/config/oro/processes.yml+++ b/crm/src/Oro/Bundle/SalesBundle/Resources/config/oro/processes.yml@@ -101,7 +101,6 @@ processes:flush: truedata:owner: $.mailbox.processSettings.owner- dataChannel: $.mailbox.processSettings.channelsource: $.leadSourceorganization: $.mailbox.organizationname: $.leadName@@ -120,3 +119,10 @@ processes:- '@add_email_activity_target':email: $.emailtarget_entity: $.leadEntity+ - '@tree':+ conditions:+ '@has_property': [$.leadEntity, 'dataChannel']+ actions:+ - '@assign_value':+ attribute: $.leadEntity.dataChannel+ value: $.mailbox.processSettings.channeldiff --git a/platform/src/Oro/Bundle/ActionBundle/Resources/config/conditions.yml b/platform/src/Oro/Bundle/ActionBundle/Resources/config/conditions.ymlindex 340d154..b71311d 100644--- a/platform/src/Oro/Bundle/ActionBundle/Resources/config/conditions.yml+++ b/platform/src/Oro/Bundle/ActionBundle/Resources/config/conditions.yml@@ -86,6 +86,11 @@ services:tags:- { name: oro_action.condition, alias: has_value }+ oro_action.expression.has_property:+ class: Oro\Component\ConfigExpression\Condition\HasProperty+ tags:+ - { name: oro_action.condition, alias: has_property }+oro_action.expression.in:class: Oro\Component\ConfigExpression\Condition\Intags:diff --git a/platform/src/Oro/Bundle/EmailBundle/Resources/config/services.yml b/platform/src/Oro/Bundle/EmailBundle/Resources/config/services.ymlindex fdfac33..22da9d1 100644--- a/platform/src/Oro/Bundle/EmailBundle/Resources/config/services.yml+++ b/platform/src/Oro/Bundle/EmailBundle/Resources/config/services.yml@@ -83,7 +83,7 @@ parameters:oro_email.emailtemplate.datagrid_view_list.class: Oro\Bundle\EmailBundle\Datagrid\EmailTemplatesViewListoro_email.emailtemplate.datagrid_helper.class: Oro\Bundle\EmailBundle\Datagrid\EmailTemplateGridHelperoro_email.emailfolder.datagrid_view_list.class: Oro\Bundle\EmailBundle\Datagrid\EmailFolderViewList- oro_email.emailseen.datagrid_view_list.class: Oro\Bundle\EmailBundle\Datagrid\EmailSeenViewList+ oro_email.emailseen.datagrid_view_list.class: Oro\Bundle\EmailBundle\Datagrid\EmailSeenViewList# Datagrid event listenersoro_email.listener.datagrid.email.class: Oro\Bundle\EmailBundle\EventListener\Datagrid\EmailGridListenerdiff --git a/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.php b/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.phpnew file mode 100644index 0000000..df8e26c--- /dev/null+++ b/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.php@@ -0,0 +1,94 @@+<?php++namespace Oro\Component\ConfigExpression\Condition;++use Symfony\Component\PropertyAccess\PropertyAccess;++use Oro\Component\ConfigExpression\ContextAccessorAwareInterface;+use Oro\Component\ConfigExpression\ContextAccessorAwareTrait;+use Oro\Component\ConfigExpression\Exception;++/**+ * Checks whether the property exists in the context.+ */+class HasProperty extends AbstractCondition implements ContextAccessorAwareInterface+{+ use ContextAccessorAwareTrait;++ /** @var string */+ protected $object;++ /** @var string */+ protected $property;++ /**+ * {@inheritdoc}+ */+ public function toArray()+ {+ throw new \BadMethodCallException('Not implemented');+ }++ /**+ * {@inheritdoc}+ */+ public function compile($factoryAccessor)+ {+ throw new \BadMethodCallException('Not implemented');+ }++ /**+ * {@inheritdoc}+ */+ protected function isConditionAllowed($context)+ {+ $object = $this->resolveValue($context, $this->object);+ $property = $this->resolveValue($context, $this->property);+ $propertyAccessor = PropertyAccess::createPropertyAccessor();++ return (+ $propertyAccessor->isReadable($object, $property)+ && $propertyAccessor->isWritable($object, $property)+ );+ }++ /**+ * Returns the expression name.+ *+ * @return string+ */+ public function getName()+ {+ return 'has_property';+ }++ /**+ * {@inheritdoc}+ */+ public function initialize(array $options)+ {+ if (2 !== count($options)) {+ throw new Exception\InvalidArgumentException(+ sprintf('Options must have 2 elements, but %d given.', count($options))+ );+ }++ if (isset($options['object'])) {+ $this->object = $options['object'];+ } elseif (isset($options[0])) {+ $this->object = $options[0];+ } else {+ throw new Exception\InvalidArgumentException('Option "object" is required.');+ }++ if (isset($options['property'])) {+ $this->property = $options['property'];+ } elseif (isset($options[1])) {+ $this->property = $options[1];+ } else {+ throw new Exception\InvalidArgumentException('Option "property" is required.');+ }++ return $this;+ }+}From 4012eef1a7b7ea5cc5daf74d2fb71efca2df2089 Mon Sep 17 00:00:00 2001From: Makar Sichevoy <sichevoy@gmail.com>Date: Wed, 22 Mar 2017 12:15:16 +0200Subject: [PATCH 2/2] BAP-14289: System Email Mailbox doesn't convert to Lead---.../ConfigExpression/Condition/HasProperty.php | 6 +-.../Tests/Unit/Condition/HasPropertyTest.php | 105 +++++++++++++++++++++2 files changed, 109 insertions(+), 2 deletions(-)create mode 100644 platform/src/Oro/Component/ConfigExpression/Tests/Unit/Condition/HasPropertyTest.phpdiff --git a/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.php b/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.phpindex df8e26c..4fc3e31 100644--- a/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.php+++ b/platform/src/Oro/Component/ConfigExpression/Condition/HasProperty.php@@ -26,7 +26,8 @@ class HasProperty extends AbstractCondition implements ContextAccessorAwareInter*/public function toArray(){- throw new \BadMethodCallException('Not implemented');+ $params = [$this->object, $this->property];+ return $this->convertToArray($params);}/**@@ -34,7 +35,8 @@ public function toArray()*/public function compile($factoryAccessor){- throw new \BadMethodCallException('Not implemented');+ $params = [$this->object, $this->property];+ return $this->convertToPhpCode($params, $factoryAccessor);}/**diff --git a/platform/src/Oro/Component/ConfigExpression/Tests/Unit/Condition/HasPropertyTest.php b/platform/src/Oro/Component/ConfigExpression/Tests/Unit/Condition/HasPropertyTest.phpnew file mode 100644index 0000000..c745b8a--- /dev/null+++ b/platform/src/Oro/Component/ConfigExpression/Tests/Unit/Condition/HasPropertyTest.php@@ -0,0 +1,105 @@+<?php++namespace Oro\Component\ConfigExpression\Tests\Unit\Condition;++use Symfony\Component\PropertyAccess\PropertyPath;++use Oro\Component\ConfigExpression\ContextAccessor;+use Oro\Component\ConfigExpression\Tests\Unit\Fixtures\ItemStub;+use Oro\Component\ConfigExpression\Condition;++class HasPropertyTest extends \PHPUnit_Framework_TestCase+{+ /** @var Condition\HasProperty */+ protected $condition;++ protected function setUp()+ {+ $this->condition = new Condition\HasProperty();+ $this->condition->setContextAccessor(new ContextAccessor());+ }++ public function testGetName()+ {+ $this->assertEquals('has_property', $this->condition->getName());+ }++ public function testEvaluate()+ {+ $options = [new PropertyPath('object'), new PropertyPath('property')];+ $object = $this->createObject(['foo' => 'fooValue']);+ $this->condition->initialize($options);+ $this->assertTrue($this->condition->evaluate(['object' => $object, 'property' => 'foo']));+ }++ public function testEvaluateWithErrors()+ {+ $options = [new PropertyPath('object'), new PropertyPath('property')];+ $object = new \stdClass();+ $this->condition->initialize($options);+ $this->assertFalse($this->condition->evaluate(['object' => $object, 'property' => 'foo']));+ }++ // @codingStandardsIgnoreStart+ /**+ * @expectedException \Oro\Component\ConfigExpression\Exception\InvalidArgumentException+ * @expectedExceptionMessage Option "object" is required.+ */+ // @codingStandardsIgnoreEnd+ public function testInitializeFailsWhenOptionOneNotDefined()+ {+ $this->condition->initialize([2 => 'anything', 3 => 'anything']);+ }++ // @codingStandardsIgnoreStart+ /**+ * @expectedException \Oro\Component\ConfigExpression\Exception\InvalidArgumentException+ * @expectedExceptionMessage Option "property" is required.+ */+ // @codingStandardsIgnoreEnd+ public function testInitializeFailsWhenOptionTwoNotDefined()+ {+ $this->condition->initialize([0 => 'anything', 3 => 'anything']);+ }++ /**+ * @expectedException \Oro\Component\ConfigExpression\Exception\InvalidArgumentException+ * @expectedExceptionMessage Options must have 2 elements, but 0 given.+ */+ public function testInitializeFailsWhenEmptyOptions()+ {+ $this->condition->initialize([]);+ }++ public function testToArray()+ {+ $options = ['one', 'two'];+ $expected = [+ '@has_property' => [+ 'parameters' => [+ 'one', 'two'+ ]+ ]+ ];+ $this->condition->initialize($options);+ $actual = $this->condition->toArray();+ $this->assertEquals($expected, $actual);+ }++ public function testCompile()+ {+ $result = $this->condition->compile('$factoryAccessor');++ $this->assertContains('$factoryAccessor->create(\'has_property\'', $result);+ }++ /**+ * @param array $data+ *+ * @return ItemStub+ */+ protected function createObject(array $data = [])+ {+ return new ItemStub($data);+ }+}Please note, that is a temporary solution, vendor patching is bad practice!
March 26, 2017 at 5:33 am #27629Hey Mike,
i’ve applied the patch and it’s now working as expected.It’s maybe worth mentioning for other users, that before applying the patch.txt, the changes from post #2 need to be rolled back or git will refuse the patch.
Thanks Again for your great support!
- AuthorReplies
The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.