PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.5.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.5.0
5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 3.1.0 All 34 releases
double-opt-in / src / Events / Mail / MailSentEvent.php

MailSentEvent.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 5.5.0, at src/Events/Mail/MailSentEvent.php

84 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Mail Sent Event
4 *
5 * @package Forge12\DoubleOptIn\Events\Mail
6 * @since 4.0.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 MailSentEvent
19 *
20 * @api
21 *
22 * Dispatched after an opt-in verification email is sent.
23 * Covered by the Addon API semver policy as of Core API 4.3.0.
24 */
25 class MailSentEvent extends Event {
26
27 private int $optInId;
28 private string $recipient;
29 private string $subject;
30 private bool $success;
31 private string $mailType;
32
33 /**
34 * Constructor.
35 *
36 * @param int $optInId The opt-in record ID.
37 * @param string $recipient The recipient email.
38 * @param string $subject The email subject.
39 * @param bool $success Whether sending was successful.
40 * @param string $mailType The type: 'optin' or 'confirmation'.
41 */
42 public function __construct(
43 int $optInId,
44 string $recipient,
45 string $subject,
46 bool $success,
47 string $mailType = 'optin'
48 ) {
49 parent::__construct();
50 $this->optInId = $optInId;
51 $this->recipient = $recipient;
52 $this->subject = $subject;
53 $this->success = $success;
54 $this->mailType = $mailType;
55 }
56
57 /**
58 * {@inheritdoc}
59 */
60 public static function getWordPressHookName(): string {
61 return 'f12_cf7_doubleoptin_mail_sent';
62 }
63
64 public function getOptInId(): int {
65 return $this->optInId;
66 }
67
68 public function getRecipient(): string {
69 return $this->recipient;
70 }
71
72 public function getSubject(): string {
73 return $this->subject;
74 }
75
76 public function wasSuccessful(): bool {
77 return $this->success;
78 }
79
80 public function getMailType(): string {
81 return $this->mailType;
82 }
83 }
84