| 1 |
<?php |
| 2 |
/** |
| 3 |
* Reminder Sent Event |
| 4 |
* |
| 5 |
* @package Forge12\DoubleOptIn\Events\Mail |
| 6 |
* @since 3.4.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Forge12\DoubleOptIn\Events\Mail; |
| 10 |
|
| 11 |
use Forge12\DoubleOptIn\EventSystem\Event; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Class ReminderSentEvent |
| 19 |
* |
| 20 |
* Dispatched after a reminder email is sent to an unconfirmed opt-in. |
| 21 |
*/ |
| 22 |
class ReminderSentEvent extends Event { |
| 23 |
|
| 24 |
private int $optInId; |
| 25 |
private string $recipient; |
| 26 |
private string $subject; |
| 27 |
private bool $success; |
| 28 |
private string $trigger; |
| 29 |
|
| 30 |
/** |
| 31 |
* Constructor. |
| 32 |
* |
| 33 |
* @param int $optInId The opt-in record ID. |
| 34 |
* @param string $recipient The recipient email. |
| 35 |
* @param string $subject The email subject. |
| 36 |
* @param bool $success Whether sending was successful. |
| 37 |
* @param string $trigger The trigger source: 'cron' or 'manual'. |
| 38 |
*/ |
| 39 |
public function __construct( |
| 40 |
int $optInId, |
| 41 |
string $recipient, |
| 42 |
string $subject, |
| 43 |
bool $success, |
| 44 |
string $trigger = 'cron' |
| 45 |
) { |
| 46 |
parent::__construct(); |
| 47 |
$this->optInId = $optInId; |
| 48 |
$this->recipient = $recipient; |
| 49 |
$this->subject = $subject; |
| 50 |
$this->success = $success; |
| 51 |
$this->trigger = $trigger; |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* {@inheritdoc} |
| 56 |
*/ |
| 57 |
public static function getWordPressHookName(): string { |
| 58 |
return 'f12_cf7_doubleoptin_reminder_sent'; |
| 59 |
} |
| 60 |
|
| 61 |
public function getOptInId(): int { |
| 62 |
return $this->optInId; |
| 63 |
} |
| 64 |
|
| 65 |
public function getRecipient(): string { |
| 66 |
return $this->recipient; |
| 67 |
} |
| 68 |
|
| 69 |
public function getSubject(): string { |
| 70 |
return $this->subject; |
| 71 |
} |
| 72 |
|
| 73 |
public function wasSuccessful(): bool { |
| 74 |
return $this->success; |
| 75 |
} |
| 76 |
|
| 77 |
public function getTrigger(): string { |
| 78 |
return $this->trigger; |
| 79 |
} |
| 80 |
} |
| 81 |
|