protected function getEmailWelcome($registerType, $user, $data, $password = '')
{
$appTitle = c('Garden.Title', c('Garden.HomepageTitle'));
// Backwards compatability. See if anybody has overridden the EmailWelcome string.
if ($emailFormat = t('EmailWelcome' . $registerType, '')) {
$welcome = formatString($emailFormat, $data);
} elseif (t('EmailWelcome', '')) {
$welcome = sprintf(t('EmailWelcome'), val('Name', $user), val('Name', val('Sender', $data)), $appTitle, externalUrl('/'), $password, val('Email', $user));
} else {
switch ($registerType) {
case 'Connect':
$welcome = formatString(t('You have successfully connected to {Title}.'), $data) . ' ' . t('Find your account information below.') . '<br></p>' . '<p>' . sprintf(t('%s: %s'), t('Username'), val('Name', $user)) . '<br>' . formatString(t('Connected With: {ProviderName}'), $data) . '<br></p>';
break;
case 'Register':
$welcome = formatString(t('You have successfully registered for an account at {Title}.'), $data) . ' ' . t('Find your account information below.') . '<br></p>' . '<p>' . sprintf(t('%s: %s'), t('Username'), val('Name', $user)) . '<br>' . sprintf(t('%s: %s'), t('Email'), val('Email', $user)) . '<br></p>';
break;
default:
$welcome = sprintf(t('%s has created an account for you at %s.'), val('Name', val('Sender', $data)), $appTitle) . ' ' . t('Find your account information below.') . '<br></p>' . '<p>' . sprintf(t('%s: %s'), t('Email'), val('Email', $user)) . '<br>' . sprintf(t('%s: %s'), t('Password'), $password) . '<br></p>';
}
}
return $welcome;
}