Formatting.
This commit is contained in:
parent
e4a2ba5474
commit
27846e1bee
|
@ -4,7 +4,12 @@ const {
|
||||||
StaticDatabases,
|
StaticDatabases,
|
||||||
} = require("@budibase/auth").db
|
} = require("@budibase/auth").db
|
||||||
const { CouchDB } = require("../../../db")
|
const { CouchDB } = require("../../../db")
|
||||||
const { TemplatePurposePretty, TemplateTypes, EmailTemplatePurpose, TemplatePurpose } = require("../../../constants")
|
const {
|
||||||
|
TemplatePurposePretty,
|
||||||
|
TemplateTypes,
|
||||||
|
EmailTemplatePurpose,
|
||||||
|
TemplatePurpose,
|
||||||
|
} = require("../../../constants")
|
||||||
const { getTemplateByPurpose } = require("../../../constants/templates")
|
const { getTemplateByPurpose } = require("../../../constants/templates")
|
||||||
|
|
||||||
const GLOBAL_DB = StaticDatabases.GLOBAL.name
|
const GLOBAL_DB = StaticDatabases.GLOBAL.name
|
||||||
|
|
|
@ -43,7 +43,7 @@ const TemplatePurposePretty = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Password Recovery",
|
name: "Password Recovery",
|
||||||
value: EmailTemplatePurpose.PASSWORD_RECOVERY
|
value: EmailTemplatePurpose.PASSWORD_RECOVERY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "New User Invitation",
|
name: "New User Invitation",
|
||||||
|
@ -52,8 +52,8 @@ const TemplatePurposePretty = {
|
||||||
{
|
{
|
||||||
name: "Custom",
|
name: "Custom",
|
||||||
value: EmailTemplatePurpose.CUSTOM,
|
value: EmailTemplatePurpose.CUSTOM,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
// all purpose combined
|
// all purpose combined
|
||||||
|
|
|
@ -5,11 +5,21 @@ const { join } = require("path")
|
||||||
const TEMPLATE_PATH = join(__dirname, "..", "constants", "templates")
|
const TEMPLATE_PATH = join(__dirname, "..", "constants", "templates")
|
||||||
|
|
||||||
exports.EmailTemplates = {
|
exports.EmailTemplates = {
|
||||||
[EmailTemplatePurpose.PASSWORD_RECOVERY]: readStaticFile(join(TEMPLATE_PATH, "passwordRecovery.html")),
|
[EmailTemplatePurpose.PASSWORD_RECOVERY]: readStaticFile(
|
||||||
[EmailTemplatePurpose.INVITATION]: readStaticFile(join(TEMPLATE_PATH, "invitation.html")),
|
join(TEMPLATE_PATH, "passwordRecovery.html")
|
||||||
[EmailTemplatePurpose.HEADER]: readStaticFile(join(TEMPLATE_PATH, "header.html")),
|
),
|
||||||
[EmailTemplatePurpose.FOOTER]: readStaticFile(join(TEMPLATE_PATH, "footer.html")),
|
[EmailTemplatePurpose.INVITATION]: readStaticFile(
|
||||||
[EmailTemplatePurpose.STYLES]: readStaticFile(join(TEMPLATE_PATH, "style.css")),
|
join(TEMPLATE_PATH, "invitation.html")
|
||||||
|
),
|
||||||
|
[EmailTemplatePurpose.HEADER]: readStaticFile(
|
||||||
|
join(TEMPLATE_PATH, "header.html")
|
||||||
|
),
|
||||||
|
[EmailTemplatePurpose.FOOTER]: readStaticFile(
|
||||||
|
join(TEMPLATE_PATH, "footer.html")
|
||||||
|
),
|
||||||
|
[EmailTemplatePurpose.STYLES]: readStaticFile(
|
||||||
|
join(TEMPLATE_PATH, "style.css")
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.getTemplateByPurpose = purpose => {
|
exports.getTemplateByPurpose = purpose => {
|
||||||
|
|
|
@ -2,4 +2,4 @@ const { readFileSync } = require("fs")
|
||||||
|
|
||||||
exports.readStaticFile = path => {
|
exports.readStaticFile = path => {
|
||||||
return readFileSync(path, "utf-8")
|
return readFileSync(path, "utf-8")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue