Loading htdocs/create.php +5 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ $accountsCreators = getAccountsCreators($domain); validateAccountOnAllServices($accountsCreators, $userData); createAccounts($accountsCreators, $userData); sendWelcomeMail($authmail, $mbox, $domain); sendWelcomeMail($authmail, $mbox, $domain, $userData->name); $done = "$authmail:$authsecret:$mbox"; $myfile = file_put_contents("/var/accounts/auth.file.done", $done . PHP_EOL, FILE_APPEND | LOCK_EX); if ($myfile === false) { Loading Loading @@ -186,11 +186,11 @@ function sendAPIResponseFromValidatedData(object $userData, ValidatedData $valid sendAPIResponse(500, $response); } function sendWelcomeMail($authmail, $mbox, $domain) function sendWelcomeMail($authmail, $mbox, $domain, $displayName) { $mailDomain = getMailDomain(); if (!empty(getenv("SENDGRID_API_KEY"))) { return sendWelcomeMailWithSendGrid($authmail, $mbox, $domain, $mailDomain); return sendWelcomeMailWithSendGrid($authmail, $mbox, $domain, $mailDomain, $displayName); } return sendWelcomeMailWithPHPMail($authmail, $mbox, $domain, $mailDomain); } Loading Loading @@ -232,7 +232,7 @@ function sendWelcomeMailWithPHPMail(string $to, string $mbox, string $domain, st $mail = $smtp->send($to, $mime->headers($headers), $body); } function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, string $mailDomain) function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, string $mailDomain, string $displayName) { $lang = strtoupper(getCurrentRequestLanguage()); $TEMPLATE_ID = getLocalizedEnv("SENDGRID_TEMPLATE_ID_ACCOUNT_CREATED", $lang); Loading @@ -241,6 +241,7 @@ function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, s new \SendGrid\Mail\Substitution("domain", $domain), new \SendGrid\Mail\Substitution("mail_domain", $mailDomain), new \SendGrid\Mail\Substitution("username", $mbox), new \SendGrid\Mail\Substitution("display_name", $displayName), ]; $email = createSendGridEmail($to, $TEMPLATE_ID, $substitutions); Loading Loading
htdocs/create.php +5 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ $accountsCreators = getAccountsCreators($domain); validateAccountOnAllServices($accountsCreators, $userData); createAccounts($accountsCreators, $userData); sendWelcomeMail($authmail, $mbox, $domain); sendWelcomeMail($authmail, $mbox, $domain, $userData->name); $done = "$authmail:$authsecret:$mbox"; $myfile = file_put_contents("/var/accounts/auth.file.done", $done . PHP_EOL, FILE_APPEND | LOCK_EX); if ($myfile === false) { Loading Loading @@ -186,11 +186,11 @@ function sendAPIResponseFromValidatedData(object $userData, ValidatedData $valid sendAPIResponse(500, $response); } function sendWelcomeMail($authmail, $mbox, $domain) function sendWelcomeMail($authmail, $mbox, $domain, $displayName) { $mailDomain = getMailDomain(); if (!empty(getenv("SENDGRID_API_KEY"))) { return sendWelcomeMailWithSendGrid($authmail, $mbox, $domain, $mailDomain); return sendWelcomeMailWithSendGrid($authmail, $mbox, $domain, $mailDomain, $displayName); } return sendWelcomeMailWithPHPMail($authmail, $mbox, $domain, $mailDomain); } Loading Loading @@ -232,7 +232,7 @@ function sendWelcomeMailWithPHPMail(string $to, string $mbox, string $domain, st $mail = $smtp->send($to, $mime->headers($headers), $body); } function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, string $mailDomain) function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, string $mailDomain, string $displayName) { $lang = strtoupper(getCurrentRequestLanguage()); $TEMPLATE_ID = getLocalizedEnv("SENDGRID_TEMPLATE_ID_ACCOUNT_CREATED", $lang); Loading @@ -241,6 +241,7 @@ function sendWelcomeMailWithSendGrid(string $to, string $mbox, string $domain, s new \SendGrid\Mail\Substitution("domain", $domain), new \SendGrid\Mail\Substitution("mail_domain", $mailDomain), new \SendGrid\Mail\Substitution("username", $mbox), new \SendGrid\Mail\Substitution("display_name", $displayName), ]; $email = createSendGridEmail($to, $TEMPLATE_ID, $substitutions); Loading