1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Dotdigitalgroup\Email\Observer\Customer;
/**
* Register new customer automation.
*/
class NewAutomation implements \Magento\Framework\Event\ObserverInterface
{
/**
* @var \Dotdigitalgroup\Email\Model\Automation
*/
private $automation;
/**
* NewAutomation constructor.
*
* @param \Dotdigitalgroup\Email\Model\Automation $automation
*/
public function __construct(
\Dotdigitalgroup\Email\Model\Automation $automation
) {
$this->automation = $automation;
}
/**
* If it's configured to capture on shipment - do this.
*
* @param \Magento\Framework\Event\Observer $observer
*
* @return $this
*/
public function execute(\Magento\Framework\Event\Observer $observer)
{
$customer = $observer->getEvent()->getCustomer();
//New Automation enrolment to queue
$this->automation->newCustomerAutomation($customer);
return $this;
}
}