Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | return id(new PhabricatorMetaMTAMail()) | ||||
PlatformSymbols::getPlatformServerName())) | PlatformSymbols::getPlatformServerName())) | ||||
->setBody($message); | ->setBody($message); | ||||
} | } | ||||
private function newBody() { | private function newBody() { | ||||
$recipient = $this->getRecipient(); | $recipient = $this->getRecipient(); | ||||
$custom_body = $this->getWelcomeMessage(); | $custom_body = $this->getWelcomeMessage(); | ||||
if (strlen($custom_body)) { | if (phutil_nonempty_string($custom_body)) { | ||||
valerio.bozzolan: ✅ I verified the above line that seems to only receive strings or null.
This is the welcome… | |||||
return $this->newRemarkupText($custom_body); | return $this->newRemarkupText($custom_body); | ||||
} | } | ||||
$default_body = PhabricatorAuthMessage::loadMessageText( | $default_body = PhabricatorAuthMessage::loadMessageText( | ||||
$recipient, | $recipient, | ||||
PhabricatorAuthWelcomeMailMessageType::MESSAGEKEY); | PhabricatorAuthWelcomeMailMessageType::MESSAGEKEY); | ||||
if (strlen($default_body)) { | if (phutil_nonempty_string($default_body)) { | ||||
Done Inline Actions✅ I verified the above line that seems to only receive strings or null. This contains the default body that an Administrator can change for custom instructions. This is the welcome message wrote by the Administrator, in raw Remarkup string form. The function phutil_nonempty_string() will report any alien type, like objects, and that is OK here. valerio.bozzolan: ✅ I verified the above line that seems to only receive strings or null.
This contains the… | |||||
return $this->newRemarkupText($default_body); | return $this->newRemarkupText($default_body); | ||||
} | } | ||||
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | ||||
if (!$is_serious) { | if (!$is_serious) { | ||||
return pht( | return pht( | ||||
"Love,\n%s", | "Love,\n%s", | ||||
PlatformSymbols::getPlatformServerName()); | PlatformSymbols::getPlatformServerName()); | ||||
} | } | ||||
Done Inline Actions(:D) valerio.bozzolan: (:D) | |||||
return null; | return null; | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ I verified the above line that seems to only receive strings or null.
This is the welcome message wrote by the Administrator, in raw Remarkup string form.
The function phutil_nonempty_string() will report any alien type, like objects, and that is OK here.