Notify transfer owners when files enter grace period.
Deploy Ladill Transfer / deploy (push) Successful in 1m0s
Deploy Ladill Transfer / deploy (push) Successful in 1m0s
Send grace-entered and countdown emails to owners alongside recipient grace milestones so unpaid transfers get clear wallet top-up reminders before deletion. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -26,6 +26,7 @@ class Transfer extends Model
|
||||
'recipient_email',
|
||||
'recipient_email_milestones',
|
||||
'recipient_milestones_sent',
|
||||
'owner_milestones_sent',
|
||||
'password_hash',
|
||||
'retention_days',
|
||||
'expires_at',
|
||||
@@ -45,6 +46,7 @@ class Transfer extends Model
|
||||
'last_billed_at' => 'datetime',
|
||||
'recipient_email_milestones' => 'array',
|
||||
'recipient_milestones_sent' => 'array',
|
||||
'owner_milestones_sent' => 'array',
|
||||
'downloads_total' => 'integer',
|
||||
'storage_bytes' => 'integer',
|
||||
];
|
||||
@@ -174,4 +176,19 @@ class Transfer extends Model
|
||||
'recipient_milestones_sent' => array_values(array_unique($sent)),
|
||||
])->save();
|
||||
}
|
||||
|
||||
public function ownerMilestoneSent(string $milestone): bool
|
||||
{
|
||||
return in_array($milestone, (array) ($this->owner_milestones_sent ?? []), true);
|
||||
}
|
||||
|
||||
public function markOwnerMilestoneSent(string $milestone): void
|
||||
{
|
||||
$sent = (array) ($this->owner_milestones_sent ?? []);
|
||||
$sent[] = $milestone;
|
||||
|
||||
$this->forceFill([
|
||||
'owner_milestones_sent' => array_values(array_unique($sent)),
|
||||
])->save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user