Skip to content

Commit

Permalink
Added campaign/reports/anonymize console command
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Mar 14, 2022
1 parent 282332e commit 604ae4a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/console/controllers/ReportsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* @copyright Copyright (c) PutYourLightsOn
*/

namespace putyourlightson\campaign\console\controllers;

use Craft;
use craft\queue\Queue;
use putyourlightson\campaign\Campaign;
use putyourlightson\campaign\records\ContactCampaignRecord;
use yii\console\Controller;
use yii\console\ExitCode;
use yii\helpers\BaseConsole;

/**
* Allows you to manage reports.
*
* @since 2.0.0
*/
class ReportsController extends Controller
{
/**
* Anonymize all previously collected personal data.
*/
public function actionAnonymize(): int
{
ContactCampaignRecord::deleteAll();

$this->stdout(Craft::t('campaign', 'Personal data successfully anonymized.') . PHP_EOL, BaseConsole::FG_GREEN);

return ExitCode::OK;
}
}
1 change: 1 addition & 0 deletions src/translations/de/campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
'Paused' => 'Pausiert',
'Pending sendouts are generally queued directly after being activated and on a scheduled basis with a cron job. You can force pending sendouts to be queued now by clicking below.' => 'Anstehende Sendungen werden gewöhnlich direkt nach Aktivierung und nach einem geplanten Zeitraum über einen Cronjob in die Warteschlange gesetzt. Durch Klicken unten können Sie dies erzwingen.',
'Pending' => 'Anstehend',
'Personal data successfully anonymized.' => '',
'Plaintext Body' => 'Text-Inhalt',
'Plaintext Template' => 'Text-Template',
'Please verify that you would like to unsubscribe from the mailing list by clicking on the following link:' => 'Bestätigen Sie bitte, dass Sie sich von der Mailing-Liste abmelden wollen durch Klick auf folgenden Link:',
Expand Down
1 change: 1 addition & 0 deletions src/translations/en/campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@
'Paused' => '',
'Pending sendouts are generally queued directly after being activated and on a scheduled basis with a cron job. You can force pending sendouts to be queued now by clicking below.' => '',
'Pending' => '',
'Personal data successfully anonymized.' => '',
'Plaintext Body' => '',
'Plaintext Template' => '',
'Please verify that you would like to unsubscribe from the mailing list by clicking on the following link:' => '',
Expand Down
1 change: 1 addition & 0 deletions src/translations/fr/campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
'Paused' => 'Mis en pause',
'Pending sendouts are generally queued directly after being activated and on a scheduled basis with a cron job. You can force pending sendouts to be queued now by clicking below.' => 'Les campagnes en attente sont généralement mis en file d’attente directement après avoir été activées sur une base planifiée avec un cron job. Cependant, vous pouvez forcer les campagnes en attente à être mise en file d’attente en cliquant ci-dessous.',
'Pending' => 'En attente',
'Personal data successfully anonymized.' => '',
'Plaintext Body' => '',
'Plaintext Template' => '',
'Please verify that you would like to unsubscribe from the mailing list by clicking on the following link:' => 'Veuillez vérifier que vous voulez vous désabonner de la liste de diffusion en cliquant sur le lien suivant :',
Expand Down

0 comments on commit 604ae4a

Please sign in to comment.