# double-opt-in/5.8.1/src/Service/ResendResult.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 5.8.1. 57 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/5.8.1/code/src/Service/ResendResult.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.8.1/raw/src/Service/ResendResult.php
- Modified: 2026-10-01T12:33:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/double-opt-in/5.8.1/code/src/Service/ResendResult.php#L10-L20`.

```php
<?php
/**
 * Outcome of re-sending a confirmation mail.
 *
 * @package Forge12\DoubleOptIn\Service
 * @since   5.8.0
 */

declare( strict_types=1 );

namespace Forge12\DoubleOptIn\Service;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Either sent, or the reason it was not. The reasons are stable strings so
 * callers can phrase them for their own audience: the admin learns that a
 * record is already confirmed, a visitor must never learn anything.
 *
 * @api
 */
final class ResendResult {

	public const SENT         = 'sent';
	public const NOT_FOUND    = 'not_found';
	public const CONFIRMED    = 'confirmed';
	public const OPTED_OUT    = 'opted_out';
	public const NO_BODY      = 'no_body';
	public const NO_RECIPIENT = 'no_recipient';
	public const SEND_FAILED  = 'send_failed';

	/** @var string */
	private $reason;

	private function __construct( string $reason ) {
		$this->reason = $reason;
	}

	public static function sent(): self {
		return new self( self::SENT );
	}

	public static function refused( string $reason ): self {
		return new self( $reason );
	}

	public function isSent(): bool {
		return $this->reason === self::SENT;
	}

	public function getReason(): string {
		return $this->reason;
	}
}

```
