| @@ -10,9 +10,8 @@ | ||
| 10 | 10 | |
| 11 | 11 | namespace Forge12\DoubleOptIn\Service; |
| 12 | 12 | |
| 13 | 13 | use Forge12\DoubleOptIn\Entity\OptIn; |
| 14 | -use Forge12\DoubleOptIn\Repository\OptInMailStatusRepository; | |
| 15 | 14 | use Forge12\DoubleOptIn\Repository\OptInRepositoryInterface; |
| 16 | 15 | use Forge12\Shared\LoggerInterface; |
| 17 | 16 | |
| 18 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -28,20 +27,11 @@ | ||
| 28 | 27 | |
| 29 | 28 | private LoggerInterface $logger; |
| 30 | 29 | private OptInRepositoryInterface $repository; |
| 31 | 30 | |
| 32 | - /** | |
| 33 | - * Delivery status of the confirmation mail (5.8.0). Optional so existing | |
| 34 | - * callers keep working. | |
| 35 | - * | |
| 36 | - * @var OptInMailStatusRepository|null | |
| 37 | - */ | |
| 38 | - private $mailStatus; | |
| 39 | - | |
| 40 | - public function __construct( LoggerInterface $logger, OptInRepositoryInterface $repository, ?OptInMailStatusRepository $mailStatus = null ) { | |
| 31 | + public function __construct( LoggerInterface $logger, OptInRepositoryInterface $repository ) { | |
| 41 | 32 | $this->logger = $logger; |
| 42 | 33 | $this->repository = $repository; |
| 43 | - $this->mailStatus = $mailStatus; | |
| 44 | 34 | } |
| 45 | 35 | |
| 46 | 36 | /** |
| 47 | 37 | * Register privacy hooks. |
| @@ -157,24 +147,8 @@ | ||
| 157 | 147 | 'value' => (string) $optIn->getFormId(), |
| 158 | 148 | ), |
| 159 | 149 | ); |
| 160 | 150 | |
| 161 | - if ( $this->mailStatus !== null ) { | |
| 162 | - $mail = $this->mailStatus->find( $optIn->getId() ); | |
| 163 | - if ( $mail['status'] !== '' ) { | |
| 164 | - // Same wording as the opt-in detail page, not the stored key. | |
| 165 | - $value = $mail['status'] === 'failed' | |
| 166 | - /* translators: %s: date and time of the attempt */ | |
| 167 | - ? sprintf( __( 'Could not be sent (%s)', 'double-opt-in' ), $mail['at'] ) | |
| 168 | - /* translators: %s: date and time the mail was handed over */ | |
| 169 | - : sprintf( __( 'Handed to the mail server (%s)', 'double-opt-in' ), $mail['at'] ); | |
| 170 | - $data[] = array( | |
| 171 | - 'name' => __( 'Confirmation mail', 'double-opt-in' ), | |
| 172 | - 'value' => $value . ( $mail['error'] !== '' ? ' — ' . $mail['error'] : '' ), | |
| 173 | - ); | |
| 174 | - } | |
| 175 | - } | |
| 176 | - | |
| 177 | 151 | $items[] = array( |
| 178 | 152 | 'group_id' => 'double-opt-in', |
| 179 | 153 | 'group_label' => __( 'Double Opt-In Records', 'double-opt-in' ), |
| 180 | 154 | 'item_id' => 'doi-' . $optIn->getId(), |
| @@ -185,9 +159,9 @@ | ||
| 185 | 159 | $this->logger->info( |
| 186 | 160 | 'Personal data exported', |
| 187 | 161 | array( |
| 188 | 162 | 'plugin' => 'double-opt-in', |
| 189 | - // No address in the log (rules/gdpr.md). | |
| 163 | + 'email' => $email, | |
| 190 | 164 | 'count' => count( $items ), |
| 191 | 165 | ) |
| 192 | 166 | ); |
| 193 | 167 | |
| @@ -218,12 +192,8 @@ | ||
| 218 | 192 | $anonymized = $this->anonymizeOptIn( $optIn ); |
| 219 | 193 | |
| 220 | 194 | try { |
| 221 | 195 | $this->repository->save( $anonymized ); |
| 222 | - // The mail error text can quote the address. | |
| 223 | - if ( $this->mailStatus !== null ) { | |
| 224 | - $this->mailStatus->clearError( $optIn->getId() ); | |
| 225 | - } | |
| 226 | 196 | ++$retained; |
| 227 | 197 | } catch ( \RuntimeException $e ) { |
| 228 | 198 | $this->logger->error( |
| 229 | 199 | 'Failed to anonymize OptIn', |
| @@ -247,9 +217,9 @@ | ||
| 247 | 217 | $this->logger->info( |
| 248 | 218 | 'Personal data anonymized', |
| 249 | 219 | array( |
| 250 | 220 | 'plugin' => 'double-opt-in', |
| 251 | - // No address in the log (rules/gdpr.md). | |
| 221 | + 'email' => $email, | |
| 252 | 222 | 'retained' => $retained, |
| 253 | 223 | ) |
| 254 | 224 | ); |
| 255 | 225 | |