77            isset($mailData[
'body']) &&
 
   78            is_string($mailData[
'body']) &&
 
   79            $mailData[
'body'] !== 
'' &&
 
   80            isset($mailData[
'subject']) &&
 
   81            is_string($mailData[
'subject']) &&
 
   82            $mailData[
'subject'] !== 
'' 
   93        $trimStrings = 
function ($value) {
 
   94            if (is_string($value)) {
 
   95                $value = trim($value);
 
  101        $this->logger->debug(sprintf(
 
  102            "Trying to send configurable email dependent welcome email to user %s (id: %s|language: %s) ...",
 
  109        if (!is_array($mailData)) {
 
  110            $this->logger->debug(sprintf(
 
  111                "Did not find any email configuration for language '%s' at all, skipping attempt ...",
 
  117        $mailData = array_map($trimStrings, $mailData);
 
  120            $this->logger->debug(sprintf(
 
  121                "Either subject or email missing, trying to determine email configuration via default language: %s",
 
  122                $this->
language->getDefaultLanguage()
 
  126            if (!is_array($mailData)) {
 
  127                $this->logger->debug(sprintf(
 
  128                    "Did not find any email configuration for language '%s' at all, skipping attempt ...",
 
  129                    $this->
language->getDefaultLanguage()
 
  134            $mailData = array_map($trimStrings, $mailData);
 
  136                $this->logger->debug(sprintf(
 
  137                    "Did not find any valid email configuration, skipping attempt ..." 
  144        $accountMail->setUser($user);
 
  146        if ($this->
settings->passwordGenerationEnabled()) {
 
  147            $accountMail->setUserPassword($rawPassword);
 
  150        if (isset($mailData[
'att_file'])) {
 
  154            $pathToFile = 
'/' . implode(
'/', array_map(
function ($pathPart) {
 
  155                return trim($pathPart, 
'/');
 
  157                $fs->getAbsolutePath(),
 
  161            $accountMail->addAttachment($pathToFile, $mailData[
'att_file']);
 
  163            $this->logger->debug(sprintf(
 
  164                "Attaching '%s' as '%s' ...",
 
  166                $mailData[
'att_file']
 
  169            $this->logger->debug(sprintf(
 
  170                "Not attachments configured for this email configuration ..." 
  174        $accountMail->send();
 
  176        $this->logger->debug(sprintf(
 
  191            $this->logger->debug(sprintf(
 
  192                "Missing email address, did not send account registration mail for user %s (id: %s) ...",
 
  199        $this->logger->debug(sprintf(
 
  200            "Sending language variable dependent welcome email to user %s (id: %s|language: %s) as fallback ...",
 
  206        $this->initMimeMail();
 
  223        if ($this->
settings->passwordGenerationEnabled()) {
 
  228        if ($this->
getMode() === self::MODE_DIRECT_REGISTRATION) {
 
  234        } elseif ($this->
getMode() === self::MODE_REGISTRATION_WITH_EMAIL_CONFIRMATION) {
 
  242        $this->
appendBody($user->getProfileAsString($this->language));
 
  247        $this->logger->debug(sprintf(
 
  257    public function send(
ilObjUser $user, $rawPassword = 
'', $usedRegistrationCode = 
false)
 
An exception for terminatinating execution or to throw for unit testing.
Class ilAccountRegistrationMail.
sendLanguageVariableBasedAccountMail(ilObjUser $user, $rawPassword, $usedRegistrationCode)
const MODE_DIRECT_REGISTRATION
send(ilObjUser $user, $rawPassword='', $usedRegistrationCode=false)
__construct(ilRegistrationSettings $settings, ilLanguage $lng, ilLogger $logger)
ilAccountRegistrationMail constructor.
withDirectRegistrationMode()
const MODE_REGISTRATION_WITH_EMAIL_CONFIRMATION
trySendingUserDefinedAccountMail(ilObjUser $user, $rawPassword)
isEmptyMailConfigurationData($mailData)
withEmailConfirmationRegistrationMode()
Component logger with individual log levels by component id.
appendBody($a_body)
Append body text.
static _getInstallationSignature()
Base class for mime mail notifications.
initLanguageByIso2Code($a_code='')
static _lookupNewAccountMail($a_lang)
getEmail()
get email address @access public
getLogin()
get login / username @access public
getFullname($a_max_strlen=0)
get fullname @access public
getLanguage()
returns a 2char-language-string @access public
getId()
get object id @access public
Class ilObjAuthSettingsGUI.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc