-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from ITPNYU/feature/email_template
Feature/email template
- Loading branch information
Showing
3 changed files
with
189 additions
and
1 deletion.
There are no files selected for viewing
169 changes: 169 additions & 0 deletions
169
media_commons_booking_app/src/client/routes/booking/booking_detail.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
.container { | ||
width: 100%; | ||
padding-right: 15px; | ||
padding-left: 15px; | ||
margin-right: auto; | ||
margin-left: auto; | ||
} | ||
|
||
.button { | ||
cursor: pointer; | ||
outline: 0; | ||
display: inline-block; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
text-align: center; | ||
background-color: transparent; | ||
border: 1px solid transparent; | ||
padding: 6px 12px; | ||
font-size: 1rem; | ||
border-radius: 0.25rem; | ||
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, | ||
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; | ||
color: #0d6efd; | ||
border-color: #0d6efd; | ||
:hover { | ||
color: #fff; | ||
background-color: #0d6efd; | ||
border-color: #0d6efd; | ||
} | ||
} | ||
|
||
.button:active { | ||
background-color: #3e8e41; | ||
box-shadow: 0 5px #666; | ||
transform: translateY(4px); | ||
} | ||
|
||
.button-red { | ||
padding: 8px 12px; | ||
border: 1px solid #ed2939; | ||
border-radius: 2px; | ||
font-family: Helvetica, Arial, sans-serif; | ||
font-size: 14px; | ||
color: #ffffff; | ||
text-decoration: none; | ||
font-weight: bold; | ||
display: inline-block; | ||
} | ||
|
||
.button-red:active { | ||
background-color: #8b0000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="index"></div> | ||
<div class="container"></div> | ||
<div class="container"> | ||
<p><?= headerMessage ?></p> | ||
<p> | ||
Room Number: | ||
<?= roomId ?> | ||
</p> | ||
|
||
<p> | ||
Email: | ||
<?= email ?> | ||
</p> | ||
<p> | ||
Start date: | ||
<?= startDate ?> | ||
</p> | ||
<p> | ||
End date: | ||
<?= endDate ?> | ||
</p> | ||
<p> | ||
Secondary Point of Contact: | ||
<?= secondaryName ?> | ||
</p> | ||
<p> | ||
NYU N-number: | ||
<?= nNumber ?> | ||
</p> | ||
<p> | ||
Net Id: | ||
<?= netId ?> | ||
</p> | ||
<p> | ||
Phone Number: | ||
<?= phoneNumber ?> | ||
</p> | ||
<p> | ||
Department: | ||
<?= department ?> | ||
</p> | ||
<p> | ||
Requestor's Role: | ||
<?= role?> | ||
</p> | ||
<p> | ||
Sponsor First Name: | ||
<?= sponsorFirstName ?> | ||
</p> | ||
<p> | ||
Sponsor Last Name: | ||
<?= sponsorLastName ?> | ||
</p> | ||
<p> | ||
Sponsor Email: | ||
<?= sponsorEmail ?> | ||
</p> | ||
<p> | ||
Reservation Title: | ||
<?= title ?> | ||
</p> | ||
<p> | ||
Reservation Description: | ||
<?= description ?> | ||
</p> | ||
<p> | ||
Expected Attendance: | ||
<?= expectedAttendance ?> | ||
</p> | ||
<p> | ||
Attendee Affiliations: | ||
<?= attendeeAffiliation ?> | ||
</p> | ||
<p> | ||
Room setup needed?: | ||
<?= roomSetup ?> | ||
<?= setupDetails ?> | ||
</p> | ||
<p> | ||
Chartfield for Room setup?: | ||
<?= chartFieldForRoomSetup ?> | ||
</p> | ||
<p> | ||
Media Services: | ||
<?= mediaServices ?> | ||
<?= mediaServicesDetails ?> | ||
</p> | ||
<p> | ||
Catering: | ||
<?= catering ?> | ||
</p> | ||
<p> | ||
Catering Details: | ||
<?= cateringService ?> | ||
</p> | ||
<p> | ||
Chartfield for Catering?: | ||
<?= chartFieldForCatering ?> | ||
</p> | ||
<p> | ||
Hire Security: | ||
<?= hireSecurity ?> | ||
</p> | ||
<p> | ||
Chartfield for Hiring Security?: | ||
<?= chartFieldForSecurity ?> | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,6 @@ export const approveBooking = (id: string) => { | |
//TODO: send email to user | ||
updateEventPrefix(id, BookingStatusLabel.PRE_APPROVED); | ||
|
||
const subject = 'Second Approval Request'; | ||
const contents = bookingContents(id); | ||
const recipient = getSecondApproverEmail(process.env.BRANCH_NAME); | ||
sendHTMLEmail( | ||
|
@@ -80,6 +79,18 @@ export const approveBooking = (id: string) => { | |
} | ||
}; | ||
|
||
export const bookingTitle = (id: string) => | ||
getActiveSheetValueById(TableNames.BOOKING, id, 16); | ||
|
||
export const sendConfirmationEmail = (id, status) => { | ||
const email = getSecondApproverEmail(process.env.BRANCH_NAME); | ||
const title = bookingTitle(id); | ||
const contents = bookingContents(id); | ||
contents.headerMessage = 'This is confirmation email.'; | ||
console.log('contents', contents); | ||
sendHTMLEmail('booking_detail', contents, email, status, title, ''); | ||
}; | ||
|
||
export const approveEvent = (id: string) => { | ||
const guestEmail = getActiveSheetValueById( | ||
TableNames.BOOKING_STATUS, | ||
|
@@ -93,6 +104,7 @@ export const approveEvent = (id: string) => { | |
eventTitle, | ||
'Your reservation request for Media Commons is approved.' | ||
); | ||
sendConfirmationEmail(id, BookingStatusLabel.APPROVED); | ||
|
||
updateEventPrefix(id, BookingStatusLabel.APPROVED); | ||
inviteUserToCalendarEvent(id, guestEmail); | ||
|
@@ -142,6 +154,7 @@ export const cancel = (id: string) => { | |
eventTitle, | ||
'Your reservation request for Media Commons has been cancelled. For detailed reasons regarding this decision, please contact us at [email protected].' | ||
); | ||
sendConfirmationEmail(id, BookingStatusLabel.CANCELED); | ||
updateEventPrefix(id, BookingStatusLabel.CANCELED); | ||
}; | ||
|
||
|
@@ -188,6 +201,7 @@ export const noShow = (id: string) => { | |
eventTitle, | ||
'You did not check-in for your Media Commons Reservation and have been marked as a no-show.' | ||
); | ||
sendConfirmationEmail(id, BookingStatusLabel.NO_SHOW); | ||
updateEventPrefix(id, BookingStatusLabel.NO_SHOW); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters