Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-06 21:20:47 +0300
committerMorris Jobke <hey@morrisjobke.de>2017-04-07 20:03:32 +0300
commit0560e6991323c156e548792c5fb1f82791868d90 (patch)
treeabaf978794200348c6975caa5fc13ca551474209 /tests/Settings
parent325f925e147ff711d12f1b433c6aa6c55d79fb40 (diff)
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.php79
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')