Add poll expiry, reminder mail and polls admin CLI
Polls are deleted POLL_RETENTION_DAYS (default 90) after creation by the cron job `bin/cake polls cleanup`. POLL_REMINDER_DAYS (default 14) before that the owner gets a one-time reminder mail (expiry_reminded_at). New commands: polls list, show (admin link only with --link), delete, remind, cleanup. The expiry date is shown in the creation mail and the dashboard. Docs: README, AGENTS.md, .env.example. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4caff47a09
commit
a19cd8339e
20 files changed
+976
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Migrations\BaseMigration;
|
||||
|
||||
/**
|
||||
* When the reminder mail before a poll expires was sent (null = not yet), so it goes out only once.
|
||||
*/
|
||||
class AddExpiryRemindedAtToPolls extends BaseMigration
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if (!$table->hasColumn('expiry_reminded_at')) {
|
||||
$table->addColumn('expiry_reminded_at', 'datetime', [
|
||||
'null' => true,
|
||||
'default' => null,
|
||||
'after' => 'last_admin_access',
|
||||
])->update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if ($table->hasColumn('expiry_reminded_at')) {
|
||||
$table->removeColumn('expiry_reminded_at')->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user