Guest User

Untitled

a guest
Dec 12th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Vendor/magento/module-customer/Controller/Account/CreatePost.php
  2.  
  3. if ($this->getRequest()->getParam('is_subscribed', false)) {
  4. $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
  5. }
  6.  
  7. <?xml version="1.0"?>
  8. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  9. <preference for="MagentoNewsletterModelSubscriber" type="HarrigoSendyConnectModelSubscriberfactory" />
  10. </config>
  11.  
  12. <?php
  13. namespace HarrigoSendyConnectModel;
  14.  
  15. use MagentoCustomerApiAccountManagementInterface;
  16. use MagentoCustomerApiCustomerRepositoryInterface;
  17. use MagentoFrameworkExceptionMailException;
  18. use MagentoFrameworkExceptionNoSuchEntityException;
  19.  
  20. class Subscriberfactory extends MagentoNewsletterModelSubscriber
  21. {
  22. public function isSubscribed()
  23. {
  24. if ($this->sendySubscribed() == "Subscribed") {
  25. return true;
  26. } else {
  27. return false;
  28. }
  29. }
  30.  
  31.  
  32. protected function _updateCustomerSubscription($customerId, $subscribe)
  33. {
  34. ...
  35. }
  36. }
Add Comment
Please, Sign In to add comment