# double-opt-in/5.8.0/src/Providers/GdprServiceProvider.php

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

- Page: https://pluginprobe.com/plugins/double-opt-in/5.8.0/code/src/Providers/GdprServiceProvider.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.8.0/raw/src/Providers/GdprServiceProvider.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.0/code/src/Providers/GdprServiceProvider.php#L10-L20`.

```php
<?php
/**
 * GDPR Service Provider
 *
 * @package Forge12\DoubleOptIn\Providers
 * @since   3.2.0
 */

namespace Forge12\DoubleOptIn\Providers;

use Forge12\DoubleOptIn\Admin\SingleConsentExportController;
use Forge12\DoubleOptIn\Container\BootableProviderInterface;
use Forge12\DoubleOptIn\Audit\ConsentAuditListener;
use Forge12\DoubleOptIn\Container\Container;
use Forge12\DoubleOptIn\EventSystem\EventDispatcherInterface;
use Forge12\DoubleOptIn\Repository\OptInRepositoryInterface;
use Forge12\DoubleOptIn\Service\PrivacyIntegration;
use Forge12\Shared\LoggerInterface;

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

/**
 * Class GdprServiceProvider
 *
 * Registers all GDPR-related services in the DI container.
 */
class GdprServiceProvider implements BootableProviderInterface {

	/**
	 * {@inheritdoc}
	 */
	public function register( Container $container ): void {
		$container->singleton(
			PrivacyIntegration::class,
			function ( Container $c ) {
				return new PrivacyIntegration(
					$c->get( LoggerInterface::class ),
					$c->get( OptInRepositoryInterface::class ),
					// Bound by MailStatusServiceProvider (5.8.0); resolved lazily.
					$c->get( \Forge12\DoubleOptIn\Repository\OptInMailStatusRepository::class )
				);
			}
		);

		$container->singleton(
			SingleConsentExportController::class,
			function ( Container $c ) {
				return new SingleConsentExportController(
					$c->get( LoggerInterface::class ),
					$c->get( OptInRepositoryInterface::class )
				);
			}
		);
	}

	/**
	 * {@inheritdoc}
	 */
	public function boot( Container $container ): void {
		// Register WordPress Privacy Tools hooks
		$container->get( PrivacyIntegration::class )->register();

		// Register single-record consent export (fallback if Pro is not active)
		$container->get( SingleConsentExportController::class )->registerActions();

		// A renewed consent is its own audit entry (5.8.0).
		if ( $container->has( EventDispatcherInterface::class ) ) {
			( new ConsentAuditListener() )->register( $container->get( EventDispatcherInterface::class ) );
		}
	}
}

```
