From 5391aeef82884e7c635b0dc08b769f387f644b3a Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 11 Jan 2021 15:37:52 -0800 Subject: [PATCH] Adde email confirmation template. --- .../schedule-day-view/schedule-day-view.container.jsx | 1 - .../schedule-job-modal/schedule-job-modal.container.jsx | 3 ++- client/src/utils/TemplateConstants.js | 7 +++++++ server/scheduling/scheduling-job.js | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/client/src/components/schedule-day-view/schedule-day-view.container.jsx b/client/src/components/schedule-day-view/schedule-day-view.container.jsx index c8f5236c4..417ade255 100644 --- a/client/src/components/schedule-day-view/schedule-day-view.container.jsx +++ b/client/src/components/schedule-day-view/schedule-day-view.container.jsx @@ -6,7 +6,6 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import moment from "moment"; import { useTranslation } from "react-i18next"; export default function ScheduleDayViewContainer({ day }) { - console.log("day", day); const { loading, error, data } = useQuery(QUERY_APPOINTMENT_BY_DATE, { variables: { start: moment(day).startOf("day"), diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx index 75b41036d..97fca225d 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx @@ -10,7 +10,7 @@ import { logImEXEvent } from "../../firebase/firebase.utils"; import { CANCEL_APPOINTMENT_BY_ID, INSERT_APPOINTMENT, - QUERY_APPOINTMENTS_BY_JOBID + QUERY_APPOINTMENTS_BY_JOBID, } from "../../graphql/appointments.queries"; import { QUERY_LBR_HRS_BY_PK, UPDATE_JOBS } from "../../graphql/jobs.queries"; import { setEmailOptions } from "../../redux/email/email.actions"; @@ -139,6 +139,7 @@ export function ScheduleJobModalContainer({ messageOptions: { to: [values.email], replyTo: bodyshop.email, + subject: TemplateList().appointment_confirmation.subject, }, template: { name: TemplateList().appointment_confirmation.key, diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index e9bfd2bd3..ab1a6123d 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -7,6 +7,13 @@ export const EmailSettings = { export const TemplateList = (type, object) => { 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"), diff --git a/server/scheduling/scheduling-job.js b/server/scheduling/scheduling-job.js index 475ce1007..490884ac4 100644 --- a/server/scheduling/scheduling-job.js +++ b/server/scheduling/scheduling-job.js @@ -112,10 +112,10 @@ exports.job = async (req, res) => { ? compDate.format("yyyy-MM-DD") : todayIsoString : todayIsoString; - + console.log("bucketMatrix", bucketMatrix); bucketMatrix[dateToUse] = { ...bucketMatrix[dateToUse], - out: bucketMatrix[dateToUse].out + 1, + out: (bucketMatrix[dateToUse].out || 0) + 1, }; } });