2022-01-10 20:33:00 +01:00
|
|
|
const { Configs } = require("@budibase/backend-core").constants
|
2021-05-11 18:49:26 +02:00
|
|
|
|
2021-04-22 18:57:38 +02:00
|
|
|
exports.LOGO_URL =
|
|
|
|
"https://d33wubrfki0l68.cloudfront.net/aac32159d7207b5085e74a7ef67afbb7027786c5/2b1fd/img/logo/bb-emblem.svg"
|
|
|
|
|
2021-03-29 18:31:41 +02:00
|
|
|
exports.UserStatus = {
|
|
|
|
ACTIVE: "active",
|
|
|
|
INACTIVE: "inactive",
|
|
|
|
}
|
2021-04-19 12:34:07 +02:00
|
|
|
|
2021-05-11 18:49:26 +02:00
|
|
|
exports.Configs = Configs
|
2021-04-21 19:43:20 +02:00
|
|
|
|
2021-05-07 14:55:30 +02:00
|
|
|
exports.ConfigUploads = {
|
|
|
|
LOGO: "logo",
|
2021-07-07 14:41:09 +02:00
|
|
|
OIDC_LOGO: "oidc_logo",
|
2021-05-07 14:55:30 +02:00
|
|
|
}
|
|
|
|
|
2021-04-22 16:26:32 +02:00
|
|
|
const TemplateTypes = {
|
2021-04-21 19:15:57 +02:00
|
|
|
EMAIL: "email",
|
|
|
|
}
|
|
|
|
|
2021-04-22 16:26:32 +02:00
|
|
|
const EmailTemplatePurpose = {
|
2021-04-22 18:57:38 +02:00
|
|
|
BASE: "base",
|
2021-04-21 19:15:57 +02:00
|
|
|
PASSWORD_RECOVERY: "password_recovery",
|
|
|
|
INVITATION: "invitation",
|
2021-04-26 15:14:51 +02:00
|
|
|
WELCOME: "welcome",
|
2021-04-21 19:15:57 +02:00
|
|
|
CUSTOM: "custom",
|
|
|
|
}
|
|
|
|
|
2021-05-17 16:30:24 +02:00
|
|
|
const InternalTemplateBindings = {
|
|
|
|
PLATFORM_URL: "platformUrl",
|
|
|
|
COMPANY: "company",
|
|
|
|
LOGO_URL: "logoUrl",
|
|
|
|
EMAIL: "email",
|
|
|
|
USER: "user",
|
|
|
|
REQUEST: "request",
|
|
|
|
DOCS_URL: "docsUrl",
|
|
|
|
LOGIN_URL: "loginUrl",
|
|
|
|
CURRENT_YEAR: "currentYear",
|
|
|
|
CURRENT_DATE: "currentDate",
|
|
|
|
BODY: "body",
|
|
|
|
STYLES: "styles",
|
|
|
|
RESET_URL: "resetUrl",
|
|
|
|
RESET_CODE: "resetCode",
|
|
|
|
INVITE_URL: "inviteUrl",
|
|
|
|
INVITE_CODE: "inviteUrl",
|
|
|
|
CONTENTS: "contents",
|
|
|
|
}
|
|
|
|
|
2021-04-22 18:57:38 +02:00
|
|
|
const TemplateBindings = {
|
2021-05-11 15:44:43 +02:00
|
|
|
PLATFORM_URL: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.PLATFORM_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The URL used to access the budibase platform",
|
|
|
|
},
|
|
|
|
COMPANY: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.COMPANY,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The name of your organization",
|
|
|
|
},
|
|
|
|
LOGO_URL: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.LOGO_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The URL of your organizations logo.",
|
|
|
|
},
|
|
|
|
EMAIL: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.EMAIL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The recipients email address.",
|
|
|
|
},
|
|
|
|
USER: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.USER,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The recipients user object.",
|
|
|
|
},
|
|
|
|
REQUEST: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.REQUEST,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "Additional request metadata.",
|
|
|
|
},
|
|
|
|
DOCS_URL: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.DOCS_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "Organization documentation URL.",
|
|
|
|
},
|
|
|
|
LOGIN_URL: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.LOGIN_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The URL used to log into the organization budibase instance.",
|
|
|
|
},
|
|
|
|
CURRENT_YEAR: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.CURRENT_YEAR,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The current year.",
|
|
|
|
},
|
|
|
|
CURRENT_DATE: {
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.CURRENT_DATE,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The current date.",
|
|
|
|
},
|
2021-04-22 18:57:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const TemplateMetadata = {
|
2021-04-22 16:26:32 +02:00
|
|
|
[TemplateTypes.EMAIL]: [
|
|
|
|
{
|
2021-07-14 12:23:24 +02:00
|
|
|
name: "Base format",
|
2021-07-14 14:18:27 +02:00
|
|
|
description:
|
|
|
|
"This is the base template, all others are based on it. The {{ body }} will be replaced with another email template.",
|
2021-07-14 12:23:24 +02:00
|
|
|
category: "miscellaneous",
|
2021-04-22 18:57:38 +02:00
|
|
|
purpose: EmailTemplatePurpose.BASE,
|
2021-05-11 15:44:43 +02:00
|
|
|
bindings: [
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.BODY,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The main body of another email template.",
|
|
|
|
},
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.STYLES,
|
2021-05-11 15:44:43 +02:00
|
|
|
description: "The contents of the Styling email template.",
|
|
|
|
},
|
|
|
|
],
|
2021-04-22 16:26:32 +02:00
|
|
|
},
|
|
|
|
{
|
2021-07-14 12:23:24 +02:00
|
|
|
name: "Password recovery",
|
2021-07-14 14:18:27 +02:00
|
|
|
description:
|
2021-07-14 14:24:46 +02:00
|
|
|
"When a user requests a password reset they will receive an email built with this template.",
|
2021-07-14 12:23:24 +02:00
|
|
|
category: "user management",
|
2021-04-22 18:57:38 +02:00
|
|
|
purpose: EmailTemplatePurpose.PASSWORD_RECOVERY,
|
2021-05-11 15:44:43 +02:00
|
|
|
bindings: [
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.RESET_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description:
|
|
|
|
"The URL the recipient must click to reset their password.",
|
|
|
|
},
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.RESET_CODE,
|
2021-05-11 15:44:43 +02:00
|
|
|
description:
|
|
|
|
"The temporary password reset code used in the recipients password reset URL.",
|
|
|
|
},
|
|
|
|
],
|
2021-04-22 16:26:32 +02:00
|
|
|
},
|
|
|
|
{
|
2021-07-14 12:23:24 +02:00
|
|
|
name: "User welcome",
|
2021-07-14 14:18:27 +02:00
|
|
|
description:
|
2021-07-14 14:24:46 +02:00
|
|
|
"When a new user is added they will be sent a welcome email using this template.",
|
2021-07-14 12:23:24 +02:00
|
|
|
category: "user management",
|
|
|
|
purpose: EmailTemplatePurpose.WELCOME,
|
|
|
|
bindings: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "User invitation",
|
2021-07-14 14:18:27 +02:00
|
|
|
description:
|
2021-07-14 14:24:46 +02:00
|
|
|
"When inviting a user via the email on-boarding this template will be used.",
|
2021-07-14 12:23:24 +02:00
|
|
|
category: "user management",
|
2021-04-22 18:57:38 +02:00
|
|
|
purpose: EmailTemplatePurpose.INVITATION,
|
2021-05-11 15:44:43 +02:00
|
|
|
bindings: [
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.INVITE_URL,
|
2021-05-11 15:44:43 +02:00
|
|
|
description:
|
|
|
|
"The URL the recipient must click to accept the invitation and activate their account.",
|
|
|
|
},
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.INVITE_CODE,
|
2021-05-11 15:44:43 +02:00
|
|
|
description:
|
|
|
|
"The temporary invite code used in the recipients invitation URL.",
|
|
|
|
},
|
|
|
|
],
|
2021-04-22 16:26:32 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Custom",
|
2021-07-14 14:18:27 +02:00
|
|
|
description:
|
2021-07-14 14:24:46 +02:00
|
|
|
"A custom template, this is currently used for SMTP email actions in automations.",
|
2021-07-14 12:23:24 +02:00
|
|
|
category: "automations",
|
2021-04-22 18:57:38 +02:00
|
|
|
purpose: EmailTemplatePurpose.CUSTOM,
|
2021-05-11 15:58:55 +02:00
|
|
|
bindings: [
|
|
|
|
{
|
2021-05-17 16:30:24 +02:00
|
|
|
name: InternalTemplateBindings.CONTENTS,
|
2021-05-11 15:58:55 +02:00
|
|
|
description: "Custom content body.",
|
|
|
|
},
|
|
|
|
],
|
2021-04-22 17:06:29 +02:00
|
|
|
},
|
|
|
|
],
|
2021-04-22 16:26:32 +02:00
|
|
|
}
|
2021-04-21 19:15:57 +02:00
|
|
|
|
2021-04-22 16:26:32 +02:00
|
|
|
// all purpose combined
|
|
|
|
exports.TemplatePurpose = {
|
|
|
|
...EmailTemplatePurpose,
|
|
|
|
}
|
|
|
|
exports.TemplateTypes = TemplateTypes
|
|
|
|
exports.EmailTemplatePurpose = EmailTemplatePurpose
|
2021-04-22 18:57:38 +02:00
|
|
|
exports.TemplateMetadata = TemplateMetadata
|
|
|
|
exports.TemplateBindings = TemplateBindings
|
2021-05-17 16:30:24 +02:00
|
|
|
exports.InternalTemplateBindings = InternalTemplateBindings
|
2021-04-23 19:54:12 +02:00
|
|
|
exports.GLOBAL_OWNER = "global"
|