Formatted email as per design
This commit is contained in:
parent
6b018d2f16
commit
b3e87d7de8
234
app/config/locale/templates/email-webhook.tpl
Normal file
234
app/config/locale/templates/email-webhook.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>
|
||||
<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">
|
||||
© 2023 Appwrite | 251 Little Falls Drive, Wilmington 19808,
|
||||
Delaware, United States
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -33,12 +33,8 @@
|
|||
"emails.certificate.footer": "Your previous certificate will be valid for 30 days since the first failure. We highly recommend investigating this case, otherwise your domain will end up without a valid SSL communication.",
|
||||
"emails.certificate.thanks": "Thanks",
|
||||
"emails.certificate.signature": "{{project}} team",
|
||||
"emails.webhook.subject": "Your webhook {{webhook}} has been stopped",
|
||||
"emails.webhook.hello": "Hello {{user}}",
|
||||
"emails.webhook.body": "Your webhook {{webhook}} on project {{project}} has been stopped after {{attempts}} consecutive failures. <br><hr><br>Webhook endpoint: {{url}}<br><hr><br>To restore the functionality of your webhook, please take the following steps:<br>1. Debug the webhook to identify and resolve the issue.<br>2. Re-enable the webhook from the project settings page.",
|
||||
"emails.webhook.footer": "If you need any assistance, please reach out to our team on Discord.",
|
||||
"emails.webhook.thanks": "Thanks",
|
||||
"emails.webhook.signature": "{{project}} team",
|
||||
"emails.webhook.subject": "Your webhook has been stopped",
|
||||
"emails.webhook.body": "Hello <strong>{{user}}</strong>,<br><br>Your webhook <strong>{{webhook}}</strong> on project <strong>{{project}}</strong> has been stopped after {{attempts}} consecutive failures. <br><br>Webhook URL: <strong>{{url}}</strong><br>Error: <strong>{{error}}</strong> <br><br>For more details, view logs of your webhook in <a href='{{link}}'>Appwrite Console</a>. <br><br>To restore the functionality of your webhook, please take the following steps:<br>1. Debug the webhook to identify and resolve the issue.<br>2. Re-enable the webhook from the project settings page.<br><br>If you need any assistance, please reach out to our team on Discord or using email support.",
|
||||
"locale.country.unknown": "Unknown",
|
||||
"countries.af": "Afghanistan",
|
||||
"countries.ao": "Angola",
|
||||
|
|
|
@ -299,6 +299,8 @@ services:
|
|||
- _APP_REDIS_PASS
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
- _APP_DOMAIN
|
||||
- _APP_OPTIONS_FORCE_HTTPS
|
||||
|
||||
appwrite-worker-deletes:
|
||||
entrypoint: worker-deletes
|
||||
|
|
|
@ -163,22 +163,26 @@ class Webhooks extends Action
|
|||
|
||||
$subject = $locale->getText("emails.webhook.subject");
|
||||
|
||||
$message = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-inner-base.tpl');
|
||||
$message = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-webhook.tpl');
|
||||
$message
|
||||
->setParam('{{hello}}', $locale->getText("emails.webhook.hello"))
|
||||
->setParam('{{body}}', $locale->getText("emails.webhook.body"))
|
||||
->setParam('{{footer}}', $locale->getText("emails.webhook.footer"))
|
||||
->setParam('{{thanks}}', $locale->getText("emails.webhook.thanks"))
|
||||
->setParam('{{signature}}', $locale->getText("emails.webhook.signature"));
|
||||
->setParam('{{subject}}', $subject)
|
||||
->setParam('{{message}}', $locale->getText("emails.webhook.body"));
|
||||
$body = $message->render();
|
||||
|
||||
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
|
||||
$hostname = App::getEnv('_APP_DOMAIN');
|
||||
$projectId = $project->getId();
|
||||
$webhookId = $webhook->getId();
|
||||
|
||||
$emailVariables = [
|
||||
'subject' => $subject,
|
||||
'user' => $user->getAttribute('name'),
|
||||
'project' => $project->getAttribute('name'),
|
||||
'redirect' => '',
|
||||
'link' => $protocol . '://' . $hostname . "/console/project-$projectId/settings/webhooks/$webhookId",
|
||||
'webhook' => $webhook->getAttribute('name'),
|
||||
'attempts' => $attempts,
|
||||
'url' => $webhook->getAttribute('url'),
|
||||
'error' => $curlError ?? \mb_strcut($responseBody, 0, 10000),
|
||||
];
|
||||
|
||||
$queueForMails
|
||||
|
|
Loading…
Reference in a new issue