| 1 |
<?php |
| 2 |
/** |
| 3 |
* OptIn Re-Opted-In Event |
| 4 |
* |
| 5 |
* @package Forge12\DoubleOptIn\Events\Lifecycle |
| 6 |
* @since 5.8.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
declare( strict_types=1 ); |
| 10 |
|
| 11 |
namespace Forge12\DoubleOptIn\Events\Lifecycle; |
| 12 |
|
| 13 |
use Forge12\DoubleOptIn\EventSystem\Event; |
| 14 |
|
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Dispatched when a withdrawn consent is given again (addon-opt-out's |
| 21 |
* "reactivate" in the subscriber's list). The counterpart of |
| 22 |
* {@see OptInOptedOutEvent}; fired only when the opt-in actually changed. |
| 23 |
* |
| 24 |
* @api Core API 4.6.0 |
| 25 |
*/ |
| 26 |
class OptInReOptedInEvent extends Event { |
| 27 |
|
| 28 |
/** @var int */ |
| 29 |
private $optInId; |
| 30 |
|
| 31 |
/** @var string */ |
| 32 |
private $hash; |
| 33 |
|
| 34 |
/** @var string */ |
| 35 |
private $email; |
| 36 |
|
| 37 |
/** @var int */ |
| 38 |
private $formId; |
| 39 |
|
| 40 |
public function __construct( int $optInId, string $hash, string $email, int $formId ) { |
| 41 |
parent::__construct(); |
| 42 |
$this->optInId = $optInId; |
| 43 |
$this->hash = $hash; |
| 44 |
$this->email = $email; |
| 45 |
$this->formId = $formId; |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* {@inheritdoc} |
| 50 |
*/ |
| 51 |
public static function getWordPressHookName(): string { |
| 52 |
return 'f12_doi_optin_reopted_in'; |
| 53 |
} |
| 54 |
|
| 55 |
public function getOptInId(): int { |
| 56 |
return $this->optInId; |
| 57 |
} |
| 58 |
|
| 59 |
public function getHash(): string { |
| 60 |
return $this->hash; |
| 61 |
} |
| 62 |
|
| 63 |
public function getEmail(): string { |
| 64 |
return $this->email; |
| 65 |
} |
| 66 |
|
| 67 |
public function getFormId(): int { |
| 68 |
return $this->formId; |
| 69 |
} |
| 70 |
} |
| 71 |
|