| @@ -9,9 +9,11 @@ | ||
| 9 | 9 | namespace Forge12\DoubleOptIn\Providers; |
| 10 | 10 | |
| 11 | 11 | use Forge12\DoubleOptIn\Admin\SingleConsentExportController; |
| 12 | 12 | use Forge12\DoubleOptIn\Container\BootableProviderInterface; |
| 13 | +use Forge12\DoubleOptIn\Audit\ConsentAuditListener; | |
| 13 | 14 | use Forge12\DoubleOptIn\Container\Container; |
| 15 | +use Forge12\DoubleOptIn\EventSystem\EventDispatcherInterface; | |
| 14 | 16 | use Forge12\DoubleOptIn\Repository\OptInRepositoryInterface; |
| 15 | 17 | use Forge12\DoubleOptIn\Service\PrivacyIntegration; |
| 16 | 18 | use Forge12\Shared\LoggerInterface; |
| 17 | 19 | |
| @@ -34,9 +36,11 @@ | ||
| 34 | 36 | PrivacyIntegration::class, |
| 35 | 37 | function ( Container $c ) { |
| 36 | 38 | return new PrivacyIntegration( |
| 37 | 39 | $c->get( LoggerInterface::class ), |
| 38 | - $c->get( OptInRepositoryInterface::class ) | |
| 40 | + $c->get( OptInRepositoryInterface::class ), | |
| 41 | + // Bound by MailStatusServiceProvider (5.8.0); resolved lazily. | |
| 42 | + $c->get( \Forge12\DoubleOptIn\Repository\OptInMailStatusRepository::class ) | |
| 39 | 43 | ); |
| 40 | 44 | } |
| 41 | 45 | ); |
| 42 | 46 | |
| @@ -59,6 +63,11 @@ | ||
| 59 | 63 | $container->get( PrivacyIntegration::class )->register(); |
| 60 | 64 | |
| 61 | 65 | // Register single-record consent export (fallback if Pro is not active) |
| 62 | 66 | $container->get( SingleConsentExportController::class )->registerActions(); |
| 67 | + | |
| 68 | + // A renewed consent is its own audit entry (5.8.0). | |
| 69 | + if ( $container->has( EventDispatcherInterface::class ) ) { | |
| 70 | + ( new ConsentAuditListener() )->register( $container->get( EventDispatcherInterface::class ) ); | |
| 71 | + } | |
| 63 | 72 | } |
| 64 | 73 | } |