Skip to content

Commit

Permalink
chore: template (#889)
Browse files Browse the repository at this point in the history
* chore: template

* fix: auto del file lifetime

* chore: delete file if fail to write to disk

* fix: modified html

* chore: set content type

* chore: md5 content

* chore: clippy

* fix: image loaded failed

* fix: build

* chore: bump collab

---------

Co-authored-by: Kilu <[email protected]>
  • Loading branch information
appflowy and qinluhe authored Oct 16, 2024
1 parent ec124bc commit d3e4a68
Show file tree
Hide file tree
Showing 14 changed files with 414 additions and 140 deletions.
18 changes: 11 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ async_zip.workspace = true
sanitize-filename.workspace = true
futures-lite = "2.3.0"

base64.workspace = true
md5.workspace = true


[dev-dependencies]
once_cell = "1.19.0"
Expand Down Expand Up @@ -276,6 +279,8 @@ pgvector = { version = "0.4", features = ["sqlx"] }
client-api-entity = { path = "libs/client-api-entity" }
async_zip = { version = "0.0.17", features = ["full"] }
sanitize-filename = "0.5.0"
base64 = "0.22"
md5 = "0.7.0"

# collaboration
yrs = { version = "0.21.2", features = ["sync"] }
Expand All @@ -299,13 +304,13 @@ debug = true
[patch.crates-io]
# It's diffcult to resovle different version with the same crate used in AppFlowy Frontend and the Client-API crate.
# So using patch to workaround this issue.
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cabf08194dff2b764ca0c7c63a2c1bdd5d02e45c" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }
collab-importer = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "7a47ee71a5d101cc467c37b0df72215549fc2c02" }

[features]
history = []
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 40 additions & 16 deletions assets/mailer_templates/build_production/import_data_fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
<![endif]-->
<title>Workspace Import Failed</title>
<style>
.p-4 {
padding: 16px
}
.py-4 {
padding-top: 16px;
padding-bottom: 16px
}
.text-white {
color: #fff
}
@media (max-width: 600px) {
.sm-px-4 {
padding-left: 16px !important;
Expand All @@ -42,12 +52,19 @@
<div class="sm-px-4 sm-py-12" style="background-color: #faf5ff; padding: 96px 48px; font-family: Helvetica, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #000">
<table align="center" cellpadding="0" cellspacing="0" role="none">
<tr>
<td style="width: 552px; max-width: 100%">
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 18px; color: #dc2626">
<span>Failed to import your notion file {{ import_file_name }}</span>
<br>
<span style="margin-left: 8px; margin-right: 8px">{{ error }}</span>
<td style="width: 622px; max-width: 100%; text-align: center">
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 24px">
<span style="font-size: 30px; font-weight: 700">Notion Import Failed</span>
</p>
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 24px;">
<span style="color: #fb006d">{{ error }}</span>
</p>
<div style="margin-left: auto; margin-right: auto; width: 70%; text-align: center; font-size: 14px; line-height: 18px; color: #64748b">
Join our Discord <a href="https://discord.gg/9Q2xaN37tV" style="color: #9327ff">server</a> to get quick help
or <a href="https://github.com/AppFlowy-IO/AppFlowy/issues/new/choose" style="color: #9327ff;">
report</a> the issue on GitHub
</div>
<div role="separator" style="background-color: #cbd5e1; height: 1px; line-height: 1px; margin: 24px 20%">&zwj;</div>
</td>
</tr>
<tr>
Expand All @@ -57,20 +74,27 @@
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/appflowy-logo.png" width="150px" style="max-width: 100%; vertical-align: middle; line-height: 1" alt="">
</a>
</p>
<p style="margin: 0; font-size: 14px; font-weight: 500; color: #000">
Bring projects, knowledge, and teams together with the power of AI.
</p>
<p style="cursor: default">
<a href="https://twitter.com/appflowy" style="margin-right: 16px; color: #4338ca; text-decoration: none">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/twitter.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://www.reddit.com/r/AppFlowy" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/reddit.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://github.com/AppFlowy-IO/AppFlowy" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/github.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://discord.gg/9Q2xaN37tV" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/discord.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
</p>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
<script>
document
.getElementById("copyErrorDetails")
.addEventListener("click", function() {
const errorDetails = document.getElementById("errorDetails");
errorDetails.select();
document.execCommand("copy");
alert("Error details copied to clipboard!");
});
</script>
</html>
71 changes: 61 additions & 10 deletions assets/mailer_templates/build_production/import_data_success.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<![endif]-->
<title>Workspace Import Success</title>
<style>
.hover-opacity-90:hover {
opacity: 0.9 !important
}
@media (max-width: 600px) {
.sm-px-4 {
padding-left: 16px !important;
Expand All @@ -42,24 +45,72 @@
<div class="sm-px-4 sm-py-12" style="background-color: #faf5ff; padding: 96px 48px; font-family: Helvetica, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #000">
<table align="center" cellpadding="0" cellspacing="0" role="none">
<tr>
<td style="width: 552px; max-width: 100%">
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 18px">
<span style="margin-left: 8px; margin-right: 8px">
Your Notion files has been successfully imported. Please open AppFlowy and switch to the new workspace
</span>
<br>
<span style="font-size: 24px; font-weight: 700">
{{ workspace_name }}
</span>
<td style="width: 582px; max-width: 100%">
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 24px">
<span style="font-size: 30px; font-weight: 700">Notion Import Complete</span>
</p>
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 24px;">
<span>Your Notion data has been successfully imported into</span>
</p>
<p style="width: 100%; white-space: normal; overflow-wrap: break-word; text-align: center; font-size: 24px;">
<span style="font-size: 30px; font-weight: 700;">{{ workspace_name }}</span>
</p>
<div role="separator" style="background-color: #cbd5e1; height: 1px; line-height: 1px; margin: 24px 20%">&zwj;</div>
<table align="center" cellpadding="0" cellspacing="0" role="none">
<tr>
<td style="width: 60px">
<div style="margin-right: 8px; height: 60px; width: 60px; overflow: hidden; border-radius: 16px; background-color: #fff; padding: 8px; border: 2px solid black">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/appflowy.png" width="100%" height="100%" alt="{{ workspace_name }}" style="max-width: 100%; vertical-align: middle; line-height: 1; overflow: hidden; object-fit: cover">
</div>
</td>
<td>
<div style="margin-bottom: 8px; font-weight: 700">
{{ workspace_name }}
</div>
<div style="font-size: 14px; color: #64748b"> 1 member</div>
</td>
</tr>
</table>
<div style="text-align: center;">
<a href="https://appflowy.io/download" class="hover-opacity-90" target="_blank" style="margin-top: 32px; margin-bottom: 32px; display: inline-block; width: 60%; cursor: pointer; border-radius: 16px; padding: 16px 24px; color: #f8fafc; text-decoration: none; background-color: #9327ff; font-size: 20px; font-weight: 400; line-height: 20px">
<!--[if mso]>
<i style="mso-font-width: 150%; mso-text-raise: 30px" hidden>&emsp;</i>
<![endif]-->
<span style="mso-text-raise: 16px">
<div style="font-size: 24px; font-weight: 500">
Download
</div>
</span>
<!--[if mso]>
<i hidden style="mso-font-width: 150%;">&emsp;&#8203;</i>
<![endif]-->
</a>
</div>
<div role="separator" style="background-color: #cbd5e1; height: 1px; line-height: 1px; margin: 24px 20%;">&zwj;</div>
</td>
</tr>
<tr>
<td style="padding-left: 24px; padding-right: 24px; text-align: center; font-size: 12px; color: #475569">
<p style="margin: 0 0 16px; cursor: pointer; text-transform: uppercase">
<a href="https://appflowy.io">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/appflowy-logo.png" width="150px" style="max-width: 100%; vertical-align: middle; line-height: 1" alt="">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/appflowy-logo.png" width="150px" style="max-width: 100%; vertical-align: middle; line-height: 1;" alt="">
</a>
</p>
<p style="margin: 0; font-size: 14px; font-weight: 500; color: #000;">
Bring projects, knowledge, and teams together with the power of AI.
</p>
<p style="cursor: default">
<a href="https://twitter.com/appflowy" style="margin-right: 16px; color: #4338ca; text-decoration: none">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/twitter.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://www.reddit.com/r/AppFlowy" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/reddit.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://github.com/AppFlowy-IO/AppFlowy" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/github.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
<a href="https://discord.gg/9Q2xaN37tV" style="margin-right: 16px; color: #4338ca; text-decoration: none;">
<img src="https://raw.githubusercontent.com/AppFlowy-IO/AppFlowy-Cloud/main/assets/mailer_templates/build_production/images/discord.png" width="20" alt="Maizzle" style="max-width: 100%; vertical-align: middle; line-height: 1;">
</a>
</p>
</td>
Expand Down
Binary file added email_template/src/images/appflowy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d3e4a68

Please sign in to comment.