-
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.
- Loading branch information
1 parent
f77f408
commit f6ea9a4
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -67,6 +67,11 @@ export const getSecondApproverEmail = (branchName: string) => | |
? '[email protected]' | ||
: '[email protected]'; // Jhanele | ||
|
||
export const getApprovalCcEmail = (branchName: string) => | ||
branchName === 'development' | ||
? '[email protected]' | ||
: '[email protected]'; // Samantha | ||
|
||
/********** ROOMS ************/ | ||
|
||
export type Purpose = 'multipleRoom' | 'motionCapture'; | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,15 @@ import { | |
DevBranch, | ||
} from '../types'; | ||
|
||
import { getApprovalCcEmail } from '../policy'; | ||
|
||
const getCcEmail = (status: BookingStatusLabel): string => { | ||
if (status !== BookingStatusLabel.APPROVED) { | ||
return ''; | ||
} | ||
return getApprovalCcEmail(process.env.BRANCH_NAME); | ||
}; | ||
|
||
export const sendTextEmail = ( | ||
targetEmail: string, | ||
status: BookingStatusLabel, | ||
|
@@ -14,6 +23,7 @@ export const sendTextEmail = ( | |
const subj = `${status}: Media Commons request for \"${eventTitle}\"`; | ||
const options = { | ||
replyTo: '[email protected]', | ||
cc: getCcEmail(status), | ||
}; | ||
GmailApp.sendEmail(targetEmail, subj, body, options); | ||
}; | ||
|
@@ -46,6 +56,7 @@ export const sendHTMLEmail = ( | |
const options = { | ||
htmlBody, | ||
replyTo: '[email protected]', | ||
cc: getCcEmail(status), | ||
}; | ||
GmailApp.sendEmail(targetEmail, subj, body, options); | ||
}; |