mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
Don't remind editors about stalled or abandoned projects
This commit is contained in:
parent
de99d1869f
commit
1f41eb1e55
2 changed files with 24 additions and 1 deletions
|
@ -712,13 +712,23 @@ final class Project{
|
|||
}
|
||||
|
||||
/**
|
||||
* Send an email reminder to the producer notifying them about their project status.
|
||||
* Send an email reminder to the producer notifying them about their project status, but only if they're not an editor.
|
||||
*/
|
||||
public function SendReminder(Enums\ProjectReminderType $type): void{
|
||||
if($this->ProducerEmail === null || $this->GetReminder($type) !== null){
|
||||
return;
|
||||
}
|
||||
|
||||
try{
|
||||
$user = User::GetByEmail($this->ProducerEmail);
|
||||
if($user->Benefits->IsEditor){
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(Exceptions\UserNotFoundException){
|
||||
// Pass.
|
||||
}
|
||||
|
||||
$reminder = new ProjectReminder();
|
||||
$reminder->ProjectId = $this->ProjectId;
|
||||
$reminder->Type = $type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue