Updated Print Center & TemplateList Object IO-587

This commit is contained in:
Patrick Fic
2021-01-19 16:30:46 -08:00
parent 4c5f9a5522
commit a29c305427
19 changed files with 152 additions and 150 deletions

View File

@@ -1,38 +1,75 @@
import i18n from "i18next";
import { store } from "../redux/store";
export const EmailSettings = {
fromNameDefault: "ImEX Online",
fromAddress: "noreply@imex.online",
};
export const TemplateList = (type, object) => {
export const TemplateList = (type, context) => {
const { bodyshop } = store.getState().user;
return {
appointment_confirmation: {
title: i18n.t("printcenter.appointments.appointment_confirmation"),
description: "Appointment Confirmation",
drivingId: "appointment",
key: "appointment_confirmation",
subject: "Appointment Confirmation",
},
//Verified Completed items
estimate_detail: {
title: i18n.t("printcenter.jobs.estimate_detail"),
description: "Est Detail",
drivingId: "job",
key: "estimate_detail",
},
parts_order_confirmation: {
title: i18n.t("printcenter.jobs.parts_order_confirmation"),
description: "Parts Order",
drivingId: "job",
key: "parts_order_confirmation",
subject: "Parts Order",
},
parts_return_confirmation: {
title: i18n.t("printcenter.jobs.parts_return_confirmation"),
description: "Parts Return",
drivingId: "job",
key: "parts_return_confirmation",
},
//If there's no type or the type is job, send it back.
...(!type || type === "job"
? {
estimate_detail: {
title: i18n.t("printcenter.jobs.estimate_detail"),
description: "Est Detail",
key: "estimate_detail",
disabled: false,
},
}
: {}),
...(!type || type === "appointment"
? {
appointment_confirmation: {
title: i18n.t("printcenter.appointments.appointment_confirmation"),
description: "Appointment Confirmation",
key: "appointment_confirmation",
subject: "Appointment Confirmation",
disabled: false,
},
}
: {}),
...(!type || type === "partsorder"
? {
parts_order_confirmation: {
title: i18n.t("printcenter.jobs.parts_order_confirmation"),
description: "Parts Order",
key: "parts_order_confirmation",
subject: `${bodyshop.shopname} Parts Order ${
(context && context.job && context.job.ro_number) || ""
}`,
disabled: false,
},
parts_return_confirmation: {
title: i18n.t("printcenter.jobs.parts_return_confirmation"),
description: "Parts Return",
key: "parts_return_confirmation",
disabled: false,
},
}
: {}),
...(!type || type === "payment"
? {
payment_confirmation: {
title: i18n.t("printcenter.jobs.payment_confirmation"),
description: "Est Detail",
key: "payment_confirmation",
disabled: false,
},
}
: {}),
...(!type || type === "csi"
? {
csi_invitation: {
title: i18n.t("printcenter.jobs.csi_invitation"),
description: "CSI invite",
key: "csi_invitation",
disabled: false,
},
}
: {}),
...(!type || type === "job" ? {} : {}),
};
};