Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
Show All 22 Lines | if (!$recipient->canEstablishWebSessions()) { | ||||
'and can not log in to the web interface.')); | 'and can not log in to the web interface.')); | ||||
} | } | ||||
} | } | ||||
protected function newMail() { | protected function newMail() { | ||||
$is_set_password = $this->isSetPasswordWorkflow(); | $is_set_password = $this->isSetPasswordWorkflow(); | ||||
if ($is_set_password) { | if ($is_set_password) { | ||||
$subject = pht('[Phabricator] Account Password Link'); | $subject = pht('[%s] Account Password Link', | ||||
PhabricatorPlatformSite::getName()); | |||||
} else { | } else { | ||||
$subject = pht('[Phabricator] Account Login Link'); | $subject = pht('[%s] Account Login Link', | ||||
PhabricatorPlatformSite::getName()); | |||||
} | } | ||||
$recipient = $this->getRecipient(); | $recipient = $this->getRecipient(); | ||||
PhabricatorSystemActionEngine::willTakeAction( | PhabricatorSystemActionEngine::willTakeAction( | ||||
array($recipient->getPHID()), | array($recipient->getPHID()), | ||||
new PhabricatorAuthEmailLoginAction(), | new PhabricatorAuthEmailLoginAction(), | ||||
1); | 1); | ||||
Show All 25 Lines | protected function newMail() { | ||||
if ($have_passwords) { | if ($have_passwords) { | ||||
if ($is_set_password) { | if ($is_set_password) { | ||||
$body[] = pht( | $body[] = pht( | ||||
'You can use this link to set a password on your account:'. | 'You can use this link to set a password on your account:'. | ||||
"\n\n %s\n", | "\n\n %s\n", | ||||
$login_uri); | $login_uri); | ||||
} else if ($is_serious) { | } else if ($is_serious) { | ||||
$body[] = pht( | $body[] = pht( | ||||
"You can use this link to reset your Phabricator password:". | "You can use this link to reset your %s password:". | ||||
"\n\n %s\n", | "\n\n %s\n", | ||||
PhabricatorPlatformSite::getName(), | |||||
$login_uri); | $login_uri); | ||||
} else { | } else { | ||||
$body[] = pht( | $body[] = pht( | ||||
"Condolences on forgetting your password. You can use this ". | "Condolences on forgetting your password. You can use this ". | ||||
"link to reset it:\n\n". | "link to reset it:\n\n". | ||||
" %s\n\n". | " %s\n\n". | ||||
"After you set a new password, consider writing it down on a ". | "After you set a new password, consider writing it down on a ". | ||||
"sticky note and attaching it to your monitor so you don't ". | "sticky note and attaching it to your monitor so you don't ". | ||||
"forget again! Choosing a very short, easy-to-remember password ". | "forget again! Choosing a very short, easy-to-remember password ". | ||||
"like \"cat\" or \"1234\" might also help.\n\n". | "like \"cat\" or \"1234\" might also help.\n\n". | ||||
"Best Wishes,\nPhabricator\n", | "Best Wishes,\n%s\n", | ||||
$login_uri); | $login_uri, | ||||
PhabricatorPlatformSite::getName()); | |||||
} | } | ||||
} else { | } else { | ||||
$body[] = pht( | $body[] = pht( | ||||
"You can use this login link to regain access to your Phabricator ". | "You can use this login link to regain access to your %s ". | ||||
"account:". | "account:". | ||||
"\n\n". | "\n\n". | ||||
" %s\n", | " %s\n", | ||||
PhabricatorPlatformSite::getName(), | |||||
$login_uri); | $login_uri); | ||||
} | } | ||||
$body = implode("\n\n", $body); | $body = implode("\n\n", $body); | ||||
return id(new PhabricatorMetaMTAMail()) | return id(new PhabricatorMetaMTAMail()) | ||||
->setSubject($subject) | ->setSubject($subject) | ||||
->setBody($body); | ->setBody($body); | ||||
Show All 26 Lines |
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