From d44c4bc4b81360f1c17a9ce8201af69eca8f85e4 Mon Sep 17 00:00:00 2001 From: "riho.takagi" Date: Fri, 1 Mar 2024 15:41:26 -0500 Subject: [PATCH] Send email to user --- .../src/client/booking/components/SheetEditor.tsx | 7 ++++++- media_commons_booking_app/src/server/admin.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/media_commons_booking_app/src/client/booking/components/SheetEditor.tsx b/media_commons_booking_app/src/client/booking/components/SheetEditor.tsx index f0bcae80..51634d77 100644 --- a/media_commons_booking_app/src/client/booking/components/SheetEditor.tsx +++ b/media_commons_booking_app/src/client/booking/components/SheetEditor.tsx @@ -286,6 +286,12 @@ const SheetEditor = () => { } }); alert('Your request has been sent.'); + + serverFunctions.sendTextEmail( + email, + 'Your Request Sent to Media Commons', + 'Your reservation is not yet confirmed. The coordinator will review and finalize your reservation within a few days.' + ); setLoading(false); setSection('selectRoom'); }; @@ -301,7 +307,6 @@ const SheetEditor = () => { const sendApprovalEmail = (recipient, contents) => { var subject = 'Approval Request'; - //serverFunctions.sendTextEmail(recipient, subject, body); serverFunctions.sendHTMLEmail( 'approval_email', contents, diff --git a/media_commons_booking_app/src/server/admin.js b/media_commons_booking_app/src/server/admin.js index ddb170f2..b06cda42 100644 --- a/media_commons_booking_app/src/server/admin.js +++ b/media_commons_booking_app/src/server/admin.js @@ -118,6 +118,11 @@ export const approveEvent = (rowIndex, id) => { updateEventPrefix(id, 'APPROVED'); inviteUserToCalendarEvent(id, guestEmail); + sendTextEmail( + guestEmail, + 'Media Commons Reservation Approved', + 'Your reservation request for Media Commons is approved.' + ); }; const inviteUserToCalendarEvent = (eventId, guestEmail) => {