Added deleting of custom templates for BOD-85.
This commit is contained in:
@@ -12,9 +12,12 @@ export default async function RenderTemplate(templateObject, client, bodyshop) {
|
||||
let templateToUse;
|
||||
|
||||
if (templateRecords.templates.length === 1) {
|
||||
console.log("[ITE] Using OOTB template.");
|
||||
templateToUse = templateRecords.templates[0];
|
||||
} else if (templateRecords.templates.length === 2) {
|
||||
templateToUse = templateRecords.templates.filter((t) => !!t.bodyshopid);
|
||||
console.log("[ITE] Found custom template.");
|
||||
templateToUse = templateRecords.templates.filter((t) => !!t.bodyshopid)[0];
|
||||
console.log("templateToUse", templateToUse);
|
||||
} else {
|
||||
//No template found.Uh oh.
|
||||
alert("Template key does not exist.");
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
export const EmailSettings = {
|
||||
fromNameDefault: "Bodyshop.app",
|
||||
fromAddress: "noreply@bodyshop.app"
|
||||
fromAddress: "noreply@bodyshop.app",
|
||||
};
|
||||
|
||||
export const TemplateList = {
|
||||
appointment_reminder: {
|
||||
title: "Appointment Reminder",
|
||||
description: "Sent to a customer as a reminder of an upcoming appointment.",
|
||||
drivingId: "Appointment Id",
|
||||
},
|
||||
parts_order_confirmation: {
|
||||
title: "Parts Order Confirmation",
|
||||
description: "Parts order template including part details",
|
||||
drivingId: "Parts order Id",
|
||||
},
|
||||
test_Template: {
|
||||
title: "Test",
|
||||
description: "Test - does nto exist.",
|
||||
drivingId: "test does not exist.",
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user