diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index de3b00c4b6..e5e6e19554 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -275,6 +275,10 @@ final class PhabricatorProject extends PhabricatorProjectDAO } public function save() { + if (!$this->getMailKey()) { + $this->setMailKey(Filesystem::readRandomCharacters(20)); + } + $this->openTransaction(); $result = parent::save(); $this->updateDatasourceTokens();