diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-06 13:20:47 -0500 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-07 12:03:32 -0500 |
commit | 0560e6991323c156e548792c5fb1f82791868d90 (patch) | |
tree | abaf978794200348c6975caa5fc13ca551474209 /tests/Settings | |
parent | 325f925e147ff711d12f1b433c6aa6c55d79fb40 (diff) | |
download | nextcloud-server-0560e6991323c156e548792c5fb1f82791868d90.tar.gz nextcloud-server-0560e6991323c156e548792c5fb1f82791868d90.zip |
New layout for welcome email
* thanks to @espina2 for make this nice design
* the button says "Set password" if the admin didn't specified a password
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/Controller/UsersControllerTest.php | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/tests/Settings/Controller/UsersControllerTest.php b/tests/Settings/Controller/UsersControllerTest.php index 3cdde1b2d27..2ed298df2dc 100644 --- a/tests/Settings/Controller/UsersControllerTest.php +++ b/tests/Settings/Controller/UsersControllerTest.php @@ -12,6 +12,7 @@ namespace Tests\Settings\Controller; use OC\Accounts\AccountManager; use OC\Group\Manager; +use OC\Mail\EMailTemplate; use OC\Settings\Controller\UsersController; use OCP\App\IAppManager; use OCP\AppFramework\Http; @@ -1427,32 +1428,33 @@ class UsersControllerTest extends \Test\TestCase { ->expects($this->at(1)) ->method('setSubject') ->with('Your account was created'); - $htmlBody = new Http\TemplateResponse( - 'settings', - 'email.new_user', - [ - 'username' => 'foo', - 'url' => '', - ], - 'blank' + + $emailTemplate = new EMailTemplate($this->defaults); + + $emailTemplate->addHeader('https://example.org/img/logo-mail-header.png'); + + $emailTemplate->addHeading('Welcome aboard'); + $emailTemplate->addBodyText('You have now an Nextcloud account, you can add, protect, and share your data.'); + $emailTemplate->addBodyText('Your username is: foo'); + + + $emailTemplate->addBodyButtonGroup( + 'Go to Nextcloud', 'https://example.org/resetPassword/123', + 'Install Client', 'https://nextcloud.com/install/#install-clients' + ); + + $emailTemplate->addFooter( + 'https://example.org/img/logo-mail-footer.png', + 'TestCloud - A safe home for your data<br>This is an automatically generated email, please do not reply.' ); $message ->expects($this->at(2)) ->method('setHtmlBody') - ->with($htmlBody->render()); - $plainBody = new Http\TemplateResponse( - 'settings', - 'email.new_user_plain_text', - [ - 'username' => 'foo', - 'url' => '', - ], - 'blank' - ); + ->with($emailTemplate->renderHTML()); $message ->expects($this->at(3)) ->method('setPlainBody') - ->with($plainBody->render()); + ->with($emailTemplate->renderText()); $message ->expects($this->at(4)) ->method('setFrom') @@ -2325,32 +2327,33 @@ class UsersControllerTest extends \Test\TestCase { ->expects($this->at(1)) ->method('setSubject') ->with('Your account was created'); - $htmlBody = new Http\TemplateResponse( - 'settings', - 'email.new_user', - [ - 'username' => 'foo', - 'url' => 'link-with-my-token', - ], - 'blank' + + $emailTemplate = new EMailTemplate($this->defaults); + + $emailTemplate->addHeader('https://example.org/img/logo-mail-header.png'); + + $emailTemplate->addHeading('Welcome aboard'); + $emailTemplate->addBodyText('You have now an Nextcloud account, you can add, protect, and share your data.'); + $emailTemplate->addBodyText('Your username is: foo'); + + + $emailTemplate->addBodyButtonGroup( + 'Go to Nextcloud', 'https://example.org/resetPassword/123', + 'Install Client', 'https://nextcloud.com/install/#install-clients' + ); + + $emailTemplate->addFooter( + 'https://example.org/img/logo-mail-footer.png', + 'TestCloud - A safe home for your data<br>This is an automatically generated email, please do not reply.' ); $message ->expects($this->at(2)) ->method('setHtmlBody') - ->with($htmlBody->render()); - $plainBody = new Http\TemplateResponse( - 'settings', - 'email.new_user_plain_text', - [ - 'username' => 'foo', - 'url' => 'link-with-my-token', - ], - 'blank' - ); + ->with($emailTemplate->renderHTML()); $message ->expects($this->at(3)) ->method('setPlainBody') - ->with($plainBody->render()); + ->with($emailTemplate->renderText()); $message ->expects($this->at(4)) ->method('setFrom') |