Added deleting of custom templates for BOD-85.

This commit is contained in:
Patrick Fic
2020-05-12 10:25:36 -07:00
parent b518f84f5f
commit 6fd485c2fe
21 changed files with 770 additions and 307 deletions

View File

@@ -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.");

View File

@@ -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.",
},
};