diff options
-rw-r--r-- | settings/Mailer/NewUserMailHelper.php | 6 | ||||
-rw-r--r-- | tests/Settings/Mailer/NewUserMailHelperTest.php | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php index 911952794fd..cd6d6ee67f5 100644 --- a/settings/Mailer/NewUserMailHelper.php +++ b/settings/Mailer/NewUserMailHelper.php @@ -115,11 +115,7 @@ class NewUserMailHelper { $link = $this->urlGenerator->getAbsoluteURL('/'); } - $emailTemplate = new EMailTemplate( - $this->themingDefaults, - $this->urlGenerator, - $this->l10n - ); + $emailTemplate = $this->mailer->createEMailTemplate(); $emailTemplate->addHeader(); $displayName = $user->getDisplayName(); $userName = $user->getUID(); diff --git a/tests/Settings/Mailer/NewUserMailHelperTest.php b/tests/Settings/Mailer/NewUserMailHelperTest.php index fee47625cfd..a8b67278e77 100644 --- a/tests/Settings/Mailer/NewUserMailHelperTest.php +++ b/tests/Settings/Mailer/NewUserMailHelperTest.php @@ -21,6 +21,7 @@ namespace Tests\Settings\Mailer; +use OC\Mail\EMailTemplate; use OCP\Mail\IEMailTemplate; use OC\Mail\Message; use OC\Settings\Mailer\NewUserMailHelper; @@ -62,6 +63,13 @@ class NewUserMailHelperTest extends TestCase { $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->l10n = $this->createMock(IL10N::class); $this->mailer = $this->createMock(IMailer::class); + $template = new EMailTemplate( + $this->defaults, + $this->urlGenerator, + $this->l10n + ); + $this->mailer->method('createEMailTemplate') + ->will($this->returnValue($template)); $this->secureRandom = $this->createMock(ISecureRandom::class); $this->timeFactory = $this->createMock(ITimeFactory::class); $this->config = $this->createMock(IConfig::class); |