Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data.php
Go to the documentation of this file.
1 <?php
7 
14 class Data
15 {
20 
24  public function __construct(\Magento\Framework\UrlInterface $frontendUrlBuilder)
25  {
26  $this->_frontendUrlBuilder = $frontendUrlBuilder;
27  }
28 
36  {
37  return $this->_frontendUrlBuilder->setScope(
38  $subscriber->getStoreId()
39  )->getUrl(
40  'newsletter/subscriber/confirm',
41  ['id' => $subscriber->getId(), 'code' => $subscriber->getCode(), '_nosid' => true]
42  );
43  }
44 
51  public function getUnsubscribeUrl($subscriber)
52  {
53  return $this->_frontendUrlBuilder->setScope(
54  $subscriber->getStoreId()
55  )->getUrl(
56  'newsletter/subscriber/unsubscribe',
57  ['id' => $subscriber->getId(), 'code' => $subscriber->getCode(), '_nosid' => true]
58  );
59  }
60 }
getUnsubscribeUrl($subscriber)
Definition: Data.php:51
__construct(\Magento\Framework\UrlInterface $frontendUrlBuilder)
Definition: Data.php:24
getConfirmationUrl($subscriber)
Definition: Data.php:35
$subscriber
Definition: subscribers.php:20