Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/mail/PhabricatorPeopleWelcomeMailEngine.php
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | protected function newMail() { | ||||
// how to add a credential to their account. | // how to add a credential to their account. | ||||
// If we aren't sure what they're supposed to be doing and passwords are | // If we aren't sure what they're supposed to be doing and passwords are | ||||
// not enabled, just give them generic instructions. | // not enabled, just give them generic instructions. | ||||
$use_passwords = PhabricatorPasswordAuthProvider::getPasswordProvider(); | $use_passwords = PhabricatorPasswordAuthProvider::getPasswordProvider(); | ||||
if ($use_passwords) { | if ($use_passwords) { | ||||
$message[] = pht( | $message[] = pht( | ||||
'To log in to Phabricator, follow this link and set a password:'); | 'To log in, follow this link and set a password:'); | ||||
$message[] = pht(' %s', $uri); | $message[] = pht(' %s', $uri); | ||||
$message[] = pht( | $message[] = pht( | ||||
'After you have set a password, you can log in to Phabricator in '. | 'After you have set a password, you can log in again in '. | ||||
'the future by going here:'); | 'the future by going here:'); | ||||
$message[] = pht(' %s', $base_uri); | $message[] = pht(' %s', $base_uri); | ||||
} else { | } else { | ||||
$message[] = pht( | $message[] = pht( | ||||
'To log in to your account for the first time, follow this link:'); | 'To log in to your account for the first time, follow this link:'); | ||||
$message[] = pht(' %s', $uri); | $message[] = pht(' %s', $uri); | ||||
$message[] = pht( | $message[] = pht( | ||||
'After you set up your account, you can log in to Phabricator in '. | 'After you set up your account, you can log in again in '. | ||||
'the future by going here:'); | 'the future by going here:'); | ||||
$message[] = pht(' %s', $base_uri); | $message[] = pht(' %s', $base_uri); | ||||
} | } | ||||
$message_body = $this->newBody(); | $message_body = $this->newBody(); | ||||
if ($message_body !== null) { | if ($message_body !== null) { | ||||
$message[] = $message_body; | $message[] = $message_body; | ||||
} | } | ||||
$message = implode("\n\n", $message); | $message = implode("\n\n", $message); | ||||
return id(new PhabricatorMetaMTAMail()) | return id(new PhabricatorMetaMTAMail()) | ||||
->setSubject(pht('[Phabricator] Welcome to Phabricator')) | ->setSubject( | ||||
pht( | |||||
'[%s] Welcome to %s', | |||||
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 (strlen($custom_body)) { | ||||
Show All 19 Lines |