2017-04-07 15:51:05 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch>
|
|
|
|
*
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
|
2020-09-07 15:37:44 +03:00
|
|
|
* @author Brad Rubenstein <brad@wbr.tech>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2020-08-24 15:54:25 +03:00
|
|
|
* @author Jan-Christoph Borchardt <hey@jancborchardt.net>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
2020-04-29 12:57:22 +03:00
|
|
|
* @author Liam JACK <liamjack@users.noreply.github.com>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2020-08-24 15:54:25 +03:00
|
|
|
* @author Simon Spannagel <simonspa@kth.se>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author zulan <git@zulan.net>
|
|
|
|
*
|
2017-04-07 15:51:05 +03:00
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2017-04-07 15:51:05 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-09-17 17:33:27 +03:00
|
|
|
namespace OCA\Settings\Tests\Mailer;
|
2017-04-07 15:51:05 +03:00
|
|
|
|
2017-06-06 18:01:53 +03:00
|
|
|
use OC\Mail\EMailTemplate;
|
2017-04-07 15:51:05 +03:00
|
|
|
use OC\Mail\Message;
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
2017-04-07 23:42:43 +03:00
|
|
|
use OCP\Defaults;
|
2017-04-07 15:51:05 +03:00
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IL10N;
|
|
|
|
use OCP\IURLGenerator;
|
|
|
|
use OCP\IUser;
|
2019-11-22 22:52:10 +03:00
|
|
|
use OCP\L10N\IFactory;
|
|
|
|
use OCP\Mail\IEMailTemplate;
|
2017-04-07 15:51:05 +03:00
|
|
|
use OCP\Mail\IMailer;
|
|
|
|
use OCP\Security\ICrypto;
|
|
|
|
use OCP\Security\ISecureRandom;
|
|
|
|
use Test\TestCase;
|
|
|
|
|
|
|
|
class NewUserMailHelperTest extends TestCase {
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var Defaults|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 23:42:43 +03:00
|
|
|
private $defaults;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $urlGenerator;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $l10n;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IMailer|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $mailer;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var ISecureRandom|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $secureRandom;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $timeFactory;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $config;
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var ICrypto|\PHPUnit\Framework\MockObject\MockObject */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $crypto;
|
2019-09-17 17:33:27 +03:00
|
|
|
/** @var \OCA\Settings\Mailer\NewUserMailHelper */
|
2017-04-07 15:51:05 +03:00
|
|
|
private $newUserMailHelper;
|
|
|
|
|
2019-11-27 17:27:18 +03:00
|
|
|
protected function setUp(): void {
|
2017-04-07 15:51:05 +03:00
|
|
|
parent::setUp();
|
|
|
|
|
2017-04-07 23:42:43 +03:00
|
|
|
$this->defaults = $this->createMock(Defaults::class);
|
2018-01-14 16:10:21 +03:00
|
|
|
$this->defaults->method('getLogo')
|
|
|
|
->willReturn('myLogo');
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
|
|
|
$this->l10n = $this->createMock(IL10N::class);
|
2018-09-24 23:54:57 +03:00
|
|
|
$this->l10nFactory = $this->createMock(IFactory::class);
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->mailer = $this->createMock(IMailer::class);
|
2017-06-06 18:01:53 +03:00
|
|
|
$template = new EMailTemplate(
|
|
|
|
$this->defaults,
|
|
|
|
$this->urlGenerator,
|
2020-03-31 15:02:39 +03:00
|
|
|
$this->l10nFactory,
|
2017-09-05 14:55:36 +03:00
|
|
|
'test.TestTemplate',
|
|
|
|
[]
|
2017-06-06 18:01:53 +03:00
|
|
|
);
|
|
|
|
$this->mailer->method('createEMailTemplate')
|
2020-03-26 00:21:27 +03:00
|
|
|
->willReturn($template);
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->secureRandom = $this->createMock(ISecureRandom::class);
|
|
|
|
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
|
|
|
$this->config = $this->createMock(IConfig::class);
|
2019-08-27 11:22:54 +03:00
|
|
|
$this->config
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getSystemValue')
|
2020-04-09 14:53:40 +03:00
|
|
|
->willReturnCallback(function ($arg) {
|
2019-08-27 11:22:54 +03:00
|
|
|
switch ($arg) {
|
|
|
|
case 'secret':
|
|
|
|
return 'MyInstanceWideSecret';
|
|
|
|
case 'customclient_desktop':
|
|
|
|
return 'https://nextcloud.com/install/#install-clients';
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
});
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->crypto = $this->createMock(ICrypto::class);
|
|
|
|
$this->l10n->method('t')
|
2020-03-26 00:21:27 +03:00
|
|
|
->willReturnCallback(function ($text, $parameters = []) {
|
2017-04-07 15:51:05 +03:00
|
|
|
return vsprintf($text, $parameters);
|
2020-03-26 00:21:27 +03:00
|
|
|
});
|
2018-09-24 23:54:57 +03:00
|
|
|
$this->l10nFactory->method('get')
|
2020-03-26 00:21:27 +03:00
|
|
|
->willReturnCallback(function ($text, $lang) {
|
2018-09-24 23:54:57 +03:00
|
|
|
return $this->l10n;
|
2020-03-26 00:21:27 +03:00
|
|
|
});
|
2017-04-07 15:51:05 +03:00
|
|
|
|
2019-09-17 17:33:27 +03:00
|
|
|
$this->newUserMailHelper = new \OCA\Settings\Mailer\NewUserMailHelper(
|
2017-04-07 23:42:43 +03:00
|
|
|
$this->defaults,
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->urlGenerator,
|
2018-09-24 23:54:57 +03:00
|
|
|
$this->l10nFactory,
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->mailer,
|
|
|
|
$this->secureRandom,
|
|
|
|
$this->timeFactory,
|
|
|
|
$this->config,
|
|
|
|
$this->crypto,
|
|
|
|
'no-reply@nextcloud.com'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGenerateTemplateWithPasswordResetToken() {
|
|
|
|
$this->secureRandom
|
|
|
|
->expects($this->once())
|
|
|
|
->method('generate')
|
|
|
|
->with(21,
|
|
|
|
ISecureRandom::CHAR_DIGITS .
|
|
|
|
ISecureRandom::CHAR_LOWER .
|
|
|
|
ISecureRandom::CHAR_UPPER
|
|
|
|
)
|
|
|
|
->willReturn('MySuperLongSecureRandomToken');
|
|
|
|
$this->timeFactory
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getTime')
|
|
|
|
->willReturn('12345');
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
|
2017-04-07 15:51:05 +03:00
|
|
|
$user = $this->createMock(IUser::class);
|
|
|
|
$user
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getEmailAddress')
|
|
|
|
->willReturn('recipient@example.com');
|
|
|
|
$this->crypto
|
|
|
|
->expects($this->once())
|
|
|
|
->method('encrypt')
|
|
|
|
->with('12345:MySuperLongSecureRandomToken', 'recipient@example.comMyInstanceWideSecret')
|
|
|
|
->willReturn('TokenCiphertext');
|
|
|
|
$user
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getUID')
|
|
|
|
->willReturn('john');
|
|
|
|
$this->config
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->once())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('setUserValue')
|
|
|
|
->with('john', 'core', 'lostpassword', 'TokenCiphertext');
|
|
|
|
$this->urlGenerator
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('linkToRouteAbsolute')
|
|
|
|
->with('core.lost.resetform', ['userId' => 'john', 'token' => 'MySuperLongSecureRandomToken'])
|
|
|
|
->willReturn('https://example.com/resetPassword/MySuperLongSecureRandomToken');
|
|
|
|
$user
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getDisplayName')
|
|
|
|
->willReturn('john');
|
|
|
|
$user
|
|
|
|
->expects($this->at(5))
|
|
|
|
->method('getUID')
|
|
|
|
->willReturn('john');
|
2017-04-07 23:42:43 +03:00
|
|
|
$this->defaults
|
2017-04-12 20:34:42 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getName')
|
|
|
|
->willReturn('TestCloud');
|
2017-12-08 14:16:05 +03:00
|
|
|
$this->defaults
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getTextColorPrimary')
|
|
|
|
->willReturn('#ffffff');
|
2017-04-07 15:51:05 +03:00
|
|
|
|
|
|
|
$expectedHtmlBody = <<<EOF
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2020-04-30 12:16:40 +03:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="-webkit-font-smoothing:antialiased;background:#fff!important">
|
2017-04-07 15:51:05 +03:00
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width">
|
|
|
|
<title></title>
|
2020-04-30 12:16:40 +03:00
|
|
|
<style type="text/css">@media only screen{html{min-height:100%;background:#fff}}@media only screen and (max-width:610px){table.body img{width:auto;height:auto}table.body center{min-width:0!important}table.body .container{width:95%!important}table.body .columns{height:auto!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:30px!important;padding-right:30px!important}th.small-12{display:inline-block!important;width:100%!important}table.menu{width:100%!important}table.menu td,table.menu th{width:auto!important;display:inline-block!important}table.menu.vertical td,table.menu.vertical th{display:block!important}table.menu[align=center]{width:auto!important}}</style>
|
2017-04-07 15:51:05 +03:00
|
|
|
</head>
|
2020-04-30 12:16:40 +03:00
|
|
|
<body style="-moz-box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;margin:0;background:#fff!important;box-sizing:border-box;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;min-width:100%;padding:0;text-align:left;width:100%!important">
|
2017-04-07 15:51:05 +03:00
|
|
|
<span class="preheader" style="color:#F5F5F5;display:none!important;font-size:1px;line-height:1px;max-height:0;max-width:0;mso-hide:all!important;opacity:0;overflow:hidden;visibility:hidden">
|
|
|
|
</span>
|
2020-04-30 12:16:40 +03:00
|
|
|
<table class="body" style="-webkit-font-smoothing:antialiased;margin:0;background:#fff;border-collapse:collapse;border-spacing:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<center data-parsed="" style="min-width:580px;width:100%"><table align="center" class="wrapper header float-center" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:20px;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:0 0;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:150px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table class="row collapse" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-11-14 18:19:44 +03:00
|
|
|
<center data-parsed="" style="background-color:;min-width:175px;max-height:175px; padding:35px 0px;border-radius:200px">
|
|
|
|
<img class="logo float-center" src="" alt="TestCloud" align="center" style="-ms-interpolation-mode:bicubic;clear:both;display:block;float:none;margin:0 auto;outline:0;text-align:center;text-decoration:none;max-height:105px;max-width:105px;width:auto;height:auto">
|
2017-04-07 15:51:05 +03:00
|
|
|
</center>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="40px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:80px;font-weight:400;hyphens:auto;line-height:80px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="container main-heading float-center" style="Margin:0 auto;background:0 0!important;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:580px">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<h1 class="text-center" style="Margin:0;Margin-bottom:10px;color:inherit;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:24px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:center;word-wrap:normal">Welcome aboard</h1>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="36px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:40px;font-weight:400;hyphens:auto;line-height:36px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="wrapper content float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:580px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"><table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
|
|
|
<p style="Margin:0;Margin-bottom:10px;color:#777;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center">Welcome to your TestCloud account, you can add, protect, and share your data.</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
|
|
|
<p style="Margin:0;Margin-bottom:10px;color:#777;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center">Your username is: john</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="50px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:50px;font-weight:400;hyphens:auto;line-height:50px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="row btn-group" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
2017-04-07 15:51:05 +03:00
|
|
|
<center data-parsed="" style="min-width:490px;width:100%">
|
2020-04-12 14:04:56 +03:00
|
|
|
<table class="button btn default primary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;margin-right:15px;max-height:60px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto;background:;background-color:;color:#fefefe;">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border:0 solid ;border-collapse:collapse!important;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://example.com/resetPassword/MySuperLongSecureRandomToken" style="Margin:0;border:0 solid ;border-radius:2px;color:#ffffff;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;outline:1px solid #ffffff;text-decoration:none">Set your password</a>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="button btn default secondary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;max-height:40px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:#777;border:0 solid #777;border-collapse:collapse!important;color:#fefefe;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://nextcloud.com/install/#install-clients" style="Margin:0;background-color:#fff;border:0 solid #777;border-radius:2px;color:#6C6C6C!important;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;outline:1px solid #CBCBCB;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">Install Client</a>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</center>
|
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table><table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="60px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:60px;font-weight:400;hyphens:auto;line-height:60px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="wrapper footer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<center data-parsed="" style="min-width:580px;width:100%">
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="15px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:15px;font-weight:400;hyphens:auto;line-height:15px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-04-30 12:16:40 +03:00
|
|
|
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table> </center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<!-- prevent Gmail on iOS font size manipulation -->
|
|
|
|
<div style="display:none;white-space:nowrap;font:15px courier;line-height:0"> </div>
|
|
|
|
</body>
|
|
|
|
</html>
|
2020-04-30 12:16:40 +03:00
|
|
|
|
2017-04-07 15:51:05 +03:00
|
|
|
EOF;
|
|
|
|
$expectedTextBody = <<<EOF
|
|
|
|
Welcome aboard
|
|
|
|
|
2017-11-09 11:24:35 +03:00
|
|
|
Welcome to your TestCloud account, you can add, protect, and share your data.
|
2017-04-07 15:51:05 +03:00
|
|
|
|
|
|
|
Your username is: john
|
|
|
|
|
|
|
|
Set your password: https://example.com/resetPassword/MySuperLongSecureRandomToken
|
|
|
|
Install Client: https://nextcloud.com/install/#install-clients
|
|
|
|
|
2017-04-12 20:34:42 +03:00
|
|
|
|
2020-04-17 17:57:18 +03:00
|
|
|
--
|
|
|
|
TestCloud -
|
2017-04-18 10:53:02 +03:00
|
|
|
This is an automatically sent email, please do not reply.
|
2017-04-07 15:51:05 +03:00
|
|
|
EOF;
|
|
|
|
|
|
|
|
$result = $this->newUserMailHelper->generateTemplate($user, true);
|
2017-04-19 01:09:25 +03:00
|
|
|
$this->assertEquals($expectedHtmlBody, $result->renderHtml());
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->assertEquals($expectedTextBody, $result->renderText());
|
|
|
|
$this->assertSame('OC\Mail\EMailTemplate', get_class($result));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGenerateTemplateWithoutPasswordResetToken() {
|
|
|
|
$this->urlGenerator
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAbsoluteURL')
|
|
|
|
->with('/')
|
|
|
|
->willReturn('https://example.com/');
|
|
|
|
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
|
2017-04-07 15:51:05 +03:00
|
|
|
$user = $this->createMock(IUser::class);
|
|
|
|
$user
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getDisplayName')
|
|
|
|
->willReturn('John Doe');
|
|
|
|
$user
|
2018-09-24 23:54:57 +03:00
|
|
|
->expects($this->any())
|
2017-04-07 15:51:05 +03:00
|
|
|
->method('getUID')
|
|
|
|
->willReturn('john');
|
2017-04-07 23:42:43 +03:00
|
|
|
$this->defaults
|
2017-04-07 15:51:05 +03:00
|
|
|
->expects($this->any())
|
|
|
|
->method('getName')
|
|
|
|
->willReturn('TestCloud');
|
2017-12-08 14:16:05 +03:00
|
|
|
$this->defaults
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getTextColorPrimary')
|
|
|
|
->willReturn('#ffffff');
|
2017-04-07 15:51:05 +03:00
|
|
|
|
|
|
|
$expectedHtmlBody = <<<EOF
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2020-04-30 12:16:40 +03:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="-webkit-font-smoothing:antialiased;background:#fff!important">
|
2017-04-07 15:51:05 +03:00
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width">
|
|
|
|
<title></title>
|
2020-04-30 12:16:40 +03:00
|
|
|
<style type="text/css">@media only screen{html{min-height:100%;background:#fff}}@media only screen and (max-width:610px){table.body img{width:auto;height:auto}table.body center{min-width:0!important}table.body .container{width:95%!important}table.body .columns{height:auto!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:30px!important;padding-right:30px!important}th.small-12{display:inline-block!important;width:100%!important}table.menu{width:100%!important}table.menu td,table.menu th{width:auto!important;display:inline-block!important}table.menu.vertical td,table.menu.vertical th{display:block!important}table.menu[align=center]{width:auto!important}}</style>
|
2017-04-07 15:51:05 +03:00
|
|
|
</head>
|
2020-04-30 12:16:40 +03:00
|
|
|
<body style="-moz-box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;margin:0;background:#fff!important;box-sizing:border-box;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;min-width:100%;padding:0;text-align:left;width:100%!important">
|
2017-04-07 15:51:05 +03:00
|
|
|
<span class="preheader" style="color:#F5F5F5;display:none!important;font-size:1px;line-height:1px;max-height:0;max-width:0;mso-hide:all!important;opacity:0;overflow:hidden;visibility:hidden">
|
|
|
|
</span>
|
2020-04-30 12:16:40 +03:00
|
|
|
<table class="body" style="-webkit-font-smoothing:antialiased;margin:0;background:#fff;border-collapse:collapse;border-spacing:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<center data-parsed="" style="min-width:580px;width:100%"><table align="center" class="wrapper header float-center" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:20px;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:0 0;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:150px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table class="row collapse" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-11-14 18:19:44 +03:00
|
|
|
<center data-parsed="" style="background-color:;min-width:175px;max-height:175px; padding:35px 0px;border-radius:200px">
|
|
|
|
<img class="logo float-center" src="" alt="TestCloud" align="center" style="-ms-interpolation-mode:bicubic;clear:both;display:block;float:none;margin:0 auto;outline:0;text-align:center;text-decoration:none;max-height:105px;max-width:105px;width:auto;height:auto">
|
2017-04-07 15:51:05 +03:00
|
|
|
</center>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="40px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:80px;font-weight:400;hyphens:auto;line-height:80px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="container main-heading float-center" style="Margin:0 auto;background:0 0!important;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:580px">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<h1 class="text-center" style="Margin:0;Margin-bottom:10px;color:inherit;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:24px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:center;word-wrap:normal">Welcome aboard John Doe</h1>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="36px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:40px;font-weight:400;hyphens:auto;line-height:36px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="wrapper content float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:580px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"><table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
|
|
|
<p style="Margin:0;Margin-bottom:10px;color:#777;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center">Welcome to your TestCloud account, you can add, protect, and share your data.</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
|
|
|
<p style="Margin:0;Margin-bottom:10px;color:#777;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center">Your username is: john</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="50px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:50px;font-weight:400;hyphens:auto;line-height:50px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="row btn-group" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
2017-04-07 15:51:05 +03:00
|
|
|
<center data-parsed="" style="min-width:490px;width:100%">
|
2020-04-12 14:04:56 +03:00
|
|
|
<table class="button btn default primary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;margin-right:15px;max-height:60px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto;background:;background-color:;color:#fefefe;">
|
2017-04-07 15:51:05 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border:0 solid ;border-collapse:collapse!important;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://example.com/" style="Margin:0;border:0 solid ;border-radius:2px;color:#ffffff;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;outline:1px solid #ffffff;text-decoration:none">Go to TestCloud</a>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="button btn default secondary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;max-height:40px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:#777;border:0 solid #777;border-collapse:collapse!important;color:#fefefe;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://nextcloud.com/install/#install-clients" style="Margin:0;background-color:#fff;border:0 solid #777;border-radius:2px;color:#6C6C6C!important;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;outline:1px solid #CBCBCB;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">Install Client</a>
|
2017-04-07 15:51:05 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</center>
|
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table><table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="60px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:60px;font-weight:400;hyphens:auto;line-height:60px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="wrapper footer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2017-04-07 15:51:05 +03:00
|
|
|
<center data-parsed="" style="min-width:580px;width:100%">
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="15px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:15px;font-weight:400;hyphens:auto;line-height:15px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2017-04-07 15:51:05 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-04-30 12:16:40 +03:00
|
|
|
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
|
2017-04-07 15:51:05 +03:00
|
|
|
</center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table> </center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<!-- prevent Gmail on iOS font size manipulation -->
|
|
|
|
<div style="display:none;white-space:nowrap;font:15px courier;line-height:0"> </div>
|
|
|
|
</body>
|
|
|
|
</html>
|
2020-04-30 12:16:40 +03:00
|
|
|
|
2017-04-07 15:51:05 +03:00
|
|
|
EOF;
|
|
|
|
$expectedTextBody = <<<EOF
|
|
|
|
Welcome aboard John Doe
|
|
|
|
|
2017-11-09 11:24:35 +03:00
|
|
|
Welcome to your TestCloud account, you can add, protect, and share your data.
|
2017-04-07 15:51:05 +03:00
|
|
|
|
|
|
|
Your username is: john
|
|
|
|
|
2020-09-02 18:16:24 +03:00
|
|
|
|
2017-04-07 15:51:05 +03:00
|
|
|
Go to TestCloud: https://example.com/
|
|
|
|
Install Client: https://nextcloud.com/install/#install-clients
|
|
|
|
|
2017-04-12 20:34:42 +03:00
|
|
|
|
2020-04-17 17:57:18 +03:00
|
|
|
--
|
|
|
|
TestCloud -
|
2019-07-26 11:48:34 +03:00
|
|
|
This is an automatically sent email, please do not reply.
|
|
|
|
EOF;
|
|
|
|
|
|
|
|
$result = $this->newUserMailHelper->generateTemplate($user, false);
|
|
|
|
$this->assertEquals($expectedHtmlBody, $result->renderHtml());
|
|
|
|
$this->assertEquals($expectedTextBody, $result->renderText());
|
|
|
|
$this->assertSame('OC\Mail\EMailTemplate', get_class($result));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGenerateTemplateWithoutUserId() {
|
|
|
|
$this->urlGenerator
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAbsoluteURL')
|
|
|
|
->with('/')
|
|
|
|
->willReturn('https://example.com/');
|
|
|
|
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
|
2019-07-26 11:48:34 +03:00
|
|
|
$user = $this->createMock(IUser::class);
|
|
|
|
$user
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getDisplayName')
|
|
|
|
->willReturn('John Doe');
|
|
|
|
$user
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getUID')
|
|
|
|
->willReturn('john');
|
|
|
|
$user
|
|
|
|
->expects($this->atLeastOnce())
|
|
|
|
->method('getBackendClassName')
|
|
|
|
->willReturn('LDAP');
|
|
|
|
$this->defaults
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getName')
|
|
|
|
->willReturn('TestCloud');
|
|
|
|
$this->defaults
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getTextColorPrimary')
|
|
|
|
->willReturn('#ffffff');
|
|
|
|
|
|
|
|
$expectedHtmlBody = <<<EOF
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2020-04-30 12:16:40 +03:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="-webkit-font-smoothing:antialiased;background:#fff!important">
|
2019-07-26 11:48:34 +03:00
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width">
|
|
|
|
<title></title>
|
2020-04-30 12:16:40 +03:00
|
|
|
<style type="text/css">@media only screen{html{min-height:100%;background:#fff}}@media only screen and (max-width:610px){table.body img{width:auto;height:auto}table.body center{min-width:0!important}table.body .container{width:95%!important}table.body .columns{height:auto!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:30px!important;padding-right:30px!important}th.small-12{display:inline-block!important;width:100%!important}table.menu{width:100%!important}table.menu td,table.menu th{width:auto!important;display:inline-block!important}table.menu.vertical td,table.menu.vertical th{display:block!important}table.menu[align=center]{width:auto!important}}</style>
|
2019-07-26 11:48:34 +03:00
|
|
|
</head>
|
2020-04-30 12:16:40 +03:00
|
|
|
<body style="-moz-box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;margin:0;background:#fff!important;box-sizing:border-box;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;min-width:100%;padding:0;text-align:left;width:100%!important">
|
2019-07-26 11:48:34 +03:00
|
|
|
<span class="preheader" style="color:#F5F5F5;display:none!important;font-size:1px;line-height:1px;max-height:0;max-width:0;mso-hide:all!important;opacity:0;overflow:hidden;visibility:hidden">
|
|
|
|
</span>
|
2020-04-30 12:16:40 +03:00
|
|
|
<table class="body" style="-webkit-font-smoothing:antialiased;margin:0;background:#fff;border-collapse:collapse;border-spacing:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<center data-parsed="" style="min-width:580px;width:100%"><table align="center" class="wrapper header float-center" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:20px;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:0 0;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:150px">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2019-07-26 11:48:34 +03:00
|
|
|
<table class="row collapse" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-11-14 18:19:44 +03:00
|
|
|
<center data-parsed="" style="background-color:;min-width:175px;max-height:175px; padding:35px 0px;border-radius:200px">
|
|
|
|
<img class="logo float-center" src="" alt="TestCloud" align="center" style="-ms-interpolation-mode:bicubic;clear:both;display:block;float:none;margin:0 auto;outline:0;text-align:center;text-decoration:none;max-height:105px;max-width:105px;width:auto;height:auto">
|
2019-07-26 11:48:34 +03:00
|
|
|
</center>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="40px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:80px;font-weight:400;hyphens:auto;line-height:80px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="container main-heading float-center" style="Margin:0 auto;background:0 0!important;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:580px">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<h1 class="text-center" style="Margin:0;Margin-bottom:10px;color:inherit;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:24px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:center;word-wrap:normal">Welcome aboard John Doe</h1>
|
2019-07-26 11:48:34 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="36px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-size:40px;font-weight:400;hyphens:auto;line-height:36px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table align="center" class="wrapper content float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<table align="center" class="container" style="Margin:0 auto;background:#fff;border-collapse:collapse;border-spacing:0;margin:0 auto;padding:0;text-align:inherit;vertical-align:top;width:580px">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"><table class="row description" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2019-07-26 11:48:34 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
|
|
|
<p style="Margin:0;Margin-bottom:10px;color:#777;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;margin-bottom:10px;padding:0;text-align:center">Welcome to your TestCloud account, you can add, protect, and share your data.</p>
|
2019-07-26 11:48:34 +03:00
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table><table class="spacer" style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="50px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:50px;font-weight:400;hyphens:auto;line-height:50px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="row btn-group" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0 auto;padding:0;padding-bottom:30px;padding-left:30px;padding-right:30px;text-align:left;width:550px">
|
2019-07-26 11:48:34 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<th style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left">
|
2019-07-26 11:48:34 +03:00
|
|
|
<center data-parsed="" style="min-width:490px;width:100%">
|
2020-04-12 14:04:56 +03:00
|
|
|
<table class="button btn default primary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;margin-right:15px;max-height:60px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto;background:;background-color:;color:#fefefe;">
|
2019-07-26 11:48:34 +03:00
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2019-07-26 11:48:34 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border:0 solid ;border-collapse:collapse!important;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://example.com/" style="Margin:0;border:0 solid ;border-radius:2px;color:#ffffff;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;outline:1px solid #ffffff;text-decoration:none">Go to TestCloud</a>
|
2019-07-26 11:48:34 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table class="button btn default secondary float-center" style="Margin:0 0 30px 0;border-collapse:collapse;border-spacing:0;display:inline-block;float:none;margin:0 0 30px 0;max-height:40px;max-width:200px;padding:0;text-align:center;vertical-align:top;width:auto">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2019-07-26 11:48:34 +03:00
|
|
|
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:#777;border:0 solid #777;border-collapse:collapse!important;color:#fefefe;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
|
|
|
<a href="https://nextcloud.com/install/#install-clients" style="Margin:0;background-color:#fff;border:0 solid #777;border-radius:2px;color:#6C6C6C!important;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;outline:1px solid #CBCBCB;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">Install Client</a>
|
2019-07-26 11:48:34 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</center>
|
|
|
|
</th>
|
2020-04-30 12:16:40 +03:00
|
|
|
<th class="expander" style="Margin:0;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table><table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="60px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:60px;font-weight:400;hyphens:auto;line-height:60px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<table align="center" class="wrapper footer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td class="wrapper-inner" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
|
2019-07-26 11:48:34 +03:00
|
|
|
<center data-parsed="" style="min-width:580px;width:100%">
|
|
|
|
<table class="spacer float-center" style="Margin:0 auto;border-collapse:collapse;border-spacing:0;float:none;margin:0 auto;padding:0;text-align:center;vertical-align:top;width:100%">
|
|
|
|
<tbody>
|
|
|
|
<tr style="padding:0;text-align:left;vertical-align:top">
|
2020-04-30 12:16:40 +03:00
|
|
|
<td height="15px" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#0a0a0a;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:15px;font-weight:400;hyphens:auto;line-height:15px;margin:0;mso-line-height-rule:exactly;padding:0;text-align:left;vertical-align:top;word-wrap:break-word"> </td>
|
2019-07-26 11:48:34 +03:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-04-30 12:16:40 +03:00
|
|
|
<p class="text-center float-center" align="center" style="Margin:0;Margin-bottom:10px;color:#C8C8C8;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;font-size:12px;font-weight:400;line-height:16px;margin:0;margin-bottom:10px;padding:0;text-align:center">TestCloud - <br>This is an automatically sent email, please do not reply.</p>
|
2019-07-26 11:48:34 +03:00
|
|
|
</center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table> </center>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<!-- prevent Gmail on iOS font size manipulation -->
|
|
|
|
<div style="display:none;white-space:nowrap;font:15px courier;line-height:0"> </div>
|
|
|
|
</body>
|
|
|
|
</html>
|
2020-04-30 12:16:40 +03:00
|
|
|
|
2019-07-26 11:48:34 +03:00
|
|
|
EOF;
|
|
|
|
$expectedTextBody = <<<EOF
|
|
|
|
Welcome aboard John Doe
|
|
|
|
|
|
|
|
Welcome to your TestCloud account, you can add, protect, and share your data.
|
|
|
|
|
2020-09-02 18:16:24 +03:00
|
|
|
|
2019-07-26 11:48:34 +03:00
|
|
|
Go to TestCloud: https://example.com/
|
|
|
|
Install Client: https://nextcloud.com/install/#install-clients
|
|
|
|
|
|
|
|
|
2020-04-17 17:57:18 +03:00
|
|
|
--
|
|
|
|
TestCloud -
|
2017-04-18 10:53:02 +03:00
|
|
|
This is an automatically sent email, please do not reply.
|
2017-04-07 15:51:05 +03:00
|
|
|
EOF;
|
|
|
|
|
|
|
|
$result = $this->newUserMailHelper->generateTemplate($user, false);
|
2017-04-19 01:09:25 +03:00
|
|
|
$this->assertEquals($expectedHtmlBody, $result->renderHtml());
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->assertEquals($expectedTextBody, $result->renderText());
|
|
|
|
$this->assertSame('OC\Mail\EMailTemplate', get_class($result));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSendMail() {
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject $user */
|
2017-04-07 15:51:05 +03:00
|
|
|
$user = $this->createMock(IUser::class);
|
|
|
|
$user
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getEMailAddress')
|
|
|
|
->willReturn('recipient@example.com');
|
|
|
|
$user
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getDisplayName')
|
|
|
|
->willReturn('John Doe');
|
2020-08-11 22:32:18 +03:00
|
|
|
/** @var IEMailTemplate|\PHPUnit\Framework\MockObject\MockObject $emailTemplate */
|
2017-04-07 15:51:05 +03:00
|
|
|
$emailTemplate = $this->createMock(IEMailTemplate::class);
|
|
|
|
$message = $this->createMock(Message::class);
|
|
|
|
$message
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('setTo')
|
|
|
|
->with(['recipient@example.com' => 'John Doe']);
|
|
|
|
$message
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('setFrom')
|
|
|
|
->with(['no-reply@nextcloud.com' => 'TestCloud']);
|
2017-09-15 12:01:21 +03:00
|
|
|
$message
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('useTemplate')
|
|
|
|
->with($emailTemplate);
|
|
|
|
$this->defaults
|
|
|
|
->expects($this->exactly(1))
|
|
|
|
->method('getName')
|
|
|
|
->willReturn('TestCloud');
|
2017-04-07 15:51:05 +03:00
|
|
|
$this->mailer
|
|
|
|
->expects($this->once())
|
|
|
|
->method('createMessage')
|
|
|
|
->willReturn($message);
|
|
|
|
|
|
|
|
$this->newUserMailHelper->sendMail($user, $emailTemplate);
|
|
|
|
}
|
|
|
|
}
|