Merge branch '1.5.x' of https://github.com/appwrite/appwrite into feat-ssr
This commit is contained in:
commit
39a351adc1
13 changed files with 248 additions and 34 deletions
234
app/config/locale/templates/email-base-styled.tpl
Normal file
234
app/config/locale/templates/email-base-styled.tpl
Normal file
|
@ -0,0 +1,234 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=DM+Sans:wght@500;600&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<style>
|
||||
.main a {
|
||||
color: currentColor;
|
||||
}
|
||||
.main {
|
||||
padding: 32px;
|
||||
line-height: 1.5;
|
||||
color: #616b7c;
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
font-family: "Inter", sans-serif;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
}
|
||||
table,
|
||||
tr,
|
||||
th,
|
||||
td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
h1 {
|
||||
font-size: 22px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
color: #373b4d;
|
||||
}
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #373b4d;
|
||||
}
|
||||
h3,
|
||||
td h3 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #373b4d;
|
||||
line-height: 21px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
h4 {
|
||||
font-family: "DM Sans", sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
color: #4f5769;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid #e8e9f0;
|
||||
}
|
||||
.main a.button {
|
||||
display: inline-block;
|
||||
background: #fd366e;
|
||||
color: #ffffff;
|
||||
border-radius: 8px;
|
||||
height: 48px;
|
||||
padding: 12px 20px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
border-color: #fd366e;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin-right: 24px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.main a.button:hover,
|
||||
.main a.button:focus {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.main a.button.is-reverse {
|
||||
background: #fff;
|
||||
color: #fd366e;
|
||||
}
|
||||
.fs12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
.ta-right {
|
||||
text-align: right !important;
|
||||
}
|
||||
.ta-left {
|
||||
text-align: left !important;
|
||||
}
|
||||
.ff-dmsans {
|
||||
font-family: "DM Sans", sans-serif !important;
|
||||
}
|
||||
.ff-inter {
|
||||
font-family: "Inter", sans-serif !important;
|
||||
}
|
||||
.w500 {
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
.w400 {
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
.w600 {
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
.tc-accent {
|
||||
color: #da1a5b;
|
||||
}
|
||||
.pt-16 {
|
||||
padding-top: 16px !important;
|
||||
}
|
||||
.pt-32 {
|
||||
padding-top: 32px !important;
|
||||
}
|
||||
.divider {
|
||||
padding-top: 32px;
|
||||
border-bottom: solid 1px #d8d8db;
|
||||
}
|
||||
.social-icon {
|
||||
border-radius: 6px;
|
||||
background: rgba(216, 216, 219, 0.1);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.social-icon > img {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 600px) {
|
||||
.button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="background-color: #ffffff; margin: 0; padding: 0;>
|
||||
<div class="main" style="max-width: 650px; margin: 0 auto">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img
|
||||
height="32px"
|
||||
src="https://appwrite.io/assets/logotype/white.png"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="margin-top: 32px">
|
||||
<tr>
|
||||
<td>
|
||||
<h1>{{subject}}</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="margin-top: 40px">
|
||||
<tr>
|
||||
<td>{{message}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
style="
|
||||
padding-top: 32px;
|
||||
margin-top: 32px;
|
||||
border-top: solid 1px #e8e9f0;
|
||||
"
|
||||
>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: auto; margin: 0 auto">
|
||||
<tr>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://twitter.com/appwrite"
|
||||
class="social-icon"
|
||||
title="Twitter"
|
||||
>
|
||||
<img src="https://appwrite.io/email/x.png" height="24" width="24" />
|
||||
</a>
|
||||
</td>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://appwrite.io/discord"
|
||||
class="social-icon"
|
||||
>
|
||||
<img src="https://appwrite.io/email/discord.png" height="24" width="24" />
|
||||
</a>
|
||||
</td>
|
||||
<td style="padding-left: 4px; padding-right: 4px">
|
||||
<a
|
||||
href="https://github.com/appwrite/appwrite"
|
||||
class="social-icon"
|
||||
>
|
||||
<img src="https://appwrite.io/email/github.png" height="24" width="24" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: auto; margin: 0 auto; margin-top: 60px">
|
||||
<tr>
|
||||
<td><a href="https://appwrite.io/terms">Terms</a></td>
|
||||
<td style="color: #e8e9f0">
|
||||
<div style="margin: 0 8px">|</div>
|
||||
</td>
|
||||
<td><a href="https://appwrite.io/privacy">Privacy</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="text-align: center" align="center">
|
||||
© {{year}} Appwrite | 251 Little Falls Drive, Wilmington 19808,
|
||||
Delaware, United States
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3218,7 +3218,6 @@ App::put('/v1/account/targets/:targetId/push')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TARGET)
|
||||
->label('docs', false)
|
||||
->param('targetId', '', new UID(), 'Target ID.')
|
||||
->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)')
|
||||
->inject('queueForEvents')
|
||||
|
|
|
@ -671,12 +671,11 @@ App::post('/v1/messaging/providers/apns')
|
|||
->param('authKeyId', '', new Text(0), 'APNS authentication key ID.', true)
|
||||
->param('teamId', '', new Text(0), 'APNS team ID.', true)
|
||||
->param('bundleId', '', new Text(0), 'APNS bundle ID.', true)
|
||||
->param('endpoint', '', new Text(0), 'APNS endpoint.', true)
|
||||
->param('enabled', null, new Boolean(), 'Set as enabled.', true)
|
||||
->inject('queueForEvents')
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, string $authKey, string $authKeyId, string $teamId, string $bundleId, string $endpoint, ?bool $enabled, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, string $authKey, string $authKeyId, string $teamId, string $bundleId, ?bool $enabled, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
$providerId = $providerId == 'unique()' ? ID::unique() : $providerId;
|
||||
|
||||
$credentials = [];
|
||||
|
@ -697,17 +696,12 @@ App::post('/v1/messaging/providers/apns')
|
|||
$credentials['bundleId'] = $bundleId;
|
||||
}
|
||||
|
||||
if (!empty($endpoint)) {
|
||||
$credentials['endpoint'] = $endpoint;
|
||||
}
|
||||
|
||||
if (
|
||||
$enabled === true
|
||||
&& \array_key_exists('authKey', $credentials)
|
||||
&& \array_key_exists('authKeyId', $credentials)
|
||||
&& \array_key_exists('teamId', $credentials)
|
||||
&& \array_key_exists('bundleId', $credentials)
|
||||
&& \array_key_exists('endpoint', $credentials)
|
||||
) {
|
||||
$enabled = true;
|
||||
} else {
|
||||
|
@ -1565,11 +1559,10 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
->param('authKeyId', '', new Text(0), 'APNS authentication key ID.', true)
|
||||
->param('teamId', '', new Text(0), 'APNS team ID.', true)
|
||||
->param('bundleId', '', new Text(0), 'APNS bundle ID.', true)
|
||||
->param('endpoint', '', new Text(0), 'APNS endpoint.', true)
|
||||
->inject('queueForEvents')
|
||||
->inject('dbForProject')
|
||||
->inject('response')
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $authKey, string $authKeyId, string $teamId, string $bundleId, string $endpoint, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
->action(function (string $providerId, string $name, ?bool $enabled, string $authKey, string $authKeyId, string $teamId, string $bundleId, Event $queueForEvents, Database $dbForProject, Response $response) {
|
||||
$provider = $dbForProject->getDocument('providers', $providerId);
|
||||
|
||||
if ($provider->isEmpty()) {
|
||||
|
@ -1603,10 +1596,6 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
$credentials['bundle'] = $bundleId;
|
||||
}
|
||||
|
||||
if (!empty($endpoint)) {
|
||||
$credentials['endpoint'] = $endpoint;
|
||||
}
|
||||
|
||||
$provider->setAttribute('credentials', $credentials);
|
||||
|
||||
if ($enabled === true || $enabled === false) {
|
||||
|
@ -1616,7 +1605,6 @@ App::patch('/v1/messaging/providers/apns/:providerId')
|
|||
&& \array_key_exists('authKeyId', $credentials)
|
||||
&& \array_key_exists('teamId', $credentials)
|
||||
&& \array_key_exists('bundleId', $credentials)
|
||||
&& \array_key_exists('endpoint', $credentials)
|
||||
) {
|
||||
$enabled = true;
|
||||
} else {
|
||||
|
@ -1696,12 +1684,9 @@ App::post('/v1/messaging/topics')
|
|||
$topic = new Document([
|
||||
'$id' => $topicId,
|
||||
'name' => $name,
|
||||
'description' => $description
|
||||
]);
|
||||
|
||||
if ($description) {
|
||||
$topic->setAttribute('description', $description);
|
||||
}
|
||||
|
||||
try {
|
||||
$topic = $dbForProject->createDocument('topics', $topic);
|
||||
} catch (DuplicateException) {
|
||||
|
|
|
@ -348,7 +348,6 @@ class Messaging extends Action
|
|||
$credentials['authKeyId'],
|
||||
$credentials['teamId'],
|
||||
$credentials['bundleId'],
|
||||
$credentials['endpoint']
|
||||
),
|
||||
'fcm' => new FCM($credentials['serviceAccountJSON']),
|
||||
default => null
|
||||
|
|
|
@ -1870,8 +1870,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$CREATE_APNS_PROVIDER:
|
||||
return 'mutation createApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!, $endpoint: String!) {
|
||||
messagingCreateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId, endpoint: $endpoint) {
|
||||
return 'mutation createApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) {
|
||||
messagingCreateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
@ -1984,8 +1984,8 @@ trait Base
|
|||
}
|
||||
}';
|
||||
case self::$UPDATE_APNS_PROVIDER:
|
||||
return 'mutation updateApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!, $endpoint: String!) {
|
||||
messagingUpdateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId, endpoint: $endpoint) {
|
||||
return 'mutation updateApnsProvider($providerId: String!, $name: String!, $authKey: String!, $authKeyId: String!, $teamId: String!, $bundleId: String!) {
|
||||
messagingUpdateApnsProvider(providerId: $providerId, name: $name, authKey: $authKey, authKeyId: $authKeyId, teamId: $teamId, bundleId: $bundleId) {
|
||||
_id
|
||||
name
|
||||
provider
|
||||
|
|
|
@ -87,7 +87,6 @@ class MessagingTest extends Scope
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -177,7 +176,6 @@ class MessagingTest extends Scope
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
foreach (\array_keys($providersParams) as $index => $key) {
|
||||
|
|
|
@ -80,7 +80,6 @@ trait MessagingBase
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
$providers = [];
|
||||
|
@ -155,7 +154,6 @@ trait MessagingBase
|
|||
'authKeyId' => 'my-authkeyid',
|
||||
'teamId' => 'my-teamid',
|
||||
'bundleId' => 'my-bundleid',
|
||||
'endpoint' => 'my-endpoint',
|
||||
],
|
||||
];
|
||||
foreach (\array_keys($providersParams) as $index => $key) {
|
||||
|
@ -245,6 +243,7 @@ trait MessagingBase
|
|||
]);
|
||||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertEquals('my-app', $response['body']['name']);
|
||||
$this->assertEquals('', $response['body']['description']);
|
||||
|
||||
return $response['body'];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue