diff --git a/packages/builder/src/pages/builder/portal/manage/email/[template].svelte b/packages/builder/src/pages/builder/portal/manage/email/[template].svelte
index cd4c7c739d..60ff3d6110 100644
--- a/packages/builder/src/pages/builder/portal/manage/email/[template].svelte
+++ b/packages/builder/src/pages/builder/portal/manage/email/[template].svelte
@@ -16,6 +16,7 @@
import Editor from "components/integration/QueryEditor.svelte"
import TemplateBindings from "./_components/TemplateBindings.svelte"
+ // this is the email purpose
export let template
let htmlEditor
@@ -24,9 +25,11 @@
$: selectedTemplate = $email.templates?.find(
({ purpose }) => purpose === template
)
+ $: name = $email.definitions?.info[template]?.name
+ $: description = $email.definitions?.info[template]?.description
$: baseTemplate = $email.templates?.find(({ purpose }) => purpose === "base")
$: templateBindings =
- $email.definitions?.bindings?.[selectedTemplate.purpose] || []
+ $email.definitions?.bindings?.[selectedTemplate?.purpose] || []
$: previewContent = makePreviewContent(baseTemplate, selectedTemplate)
async function saveTemplate() {
@@ -81,10 +84,12 @@
- Email Template: {template}
+ Email Template: {name}
+ Description
+
{description}
Change the email template here. Add dynamic content by using the bindings
menu on the right.
- import { goto } from "@roxi/routify"
-
- export let value
-
-
- $goto(`./${value}`)}>{value}
-
-
diff --git a/packages/builder/src/pages/builder/portal/manage/email/index.svelte b/packages/builder/src/pages/builder/portal/manage/email/index.svelte
index 2c7b798d5e..4a2b21b691 100644
--- a/packages/builder/src/pages/builder/portal/manage/email/index.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/email/index.svelte
@@ -14,7 +14,6 @@
Checkbox,
} from "@budibase/bbui"
import { email } from "stores/portal"
- import TemplateLink from "./_components/TemplateLink.svelte"
import api from "builderStore/api"
import { cloneDeep } from "lodash/fp"
@@ -23,23 +22,30 @@
}
const templateSchema = {
- purpose: {
- displayName: "Email",
+ name: {
+ displayName: "Name",
+ editable: false,
+ },
+ category: {
+ displayName: "Category",
editable: false,
},
}
- const customRenderers = [
- {
- column: "purpose",
- component: TemplateLink,
- },
- ]
+ $: emailInfo = getEmailInfo($email.definitions)
let smtpConfig
let loading
let requireAuth = false
+ function getEmailInfo(definitions) {
+ if (!definitions) {
+ return []
+ }
+ const entries = Object.entries(definitions.info)
+ return entries.map(([key, value]) => ({ purpose: key, ...value }))
+ }
+
async function saveSmtp() {
// clone it so we can remove stuff if required
const smtp = cloneDeep(smtpConfig)
@@ -159,8 +165,7 @@